Package org.cip4.jdflib.core
Class AttributeInfo
- java.lang.Object
-
- org.cip4.jdflib.core.AttributeInfo
-
public class AttributeInfo extends java.lang.ObjectThe maintainer of version-specific attribute information: - attribute type (for current version only) - validity per version
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAttributeInfo.EnumAttributeTypeEnumeration of valid attribute typesstatic classAttributeInfo.EnumAttributeValidityEnumeration of attribute validity values
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.String,AttributeInfo>fixedMap
-
Constructor Summary
Constructors Modifier Constructor Description protectedAttributeInfo(AtrInfoTable[] attrInfo_own)ConstructorAttributeInfo(AttributeInfo attrInfo_super, AtrInfoTable[] attrInfo_own)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description VStringconformingAttribs(AttributeInfo.EnumAttributeValidity attrValidity)Returns a list of attributes matching the requested validity for the specified JDF version.VStringdeprecatedAttribs()Returns the list of deprecated attributes for the specified JDF version.AttributeInfo.EnumAttributeTypegetAtrType(java.lang.String attributeName)Deprecated.2005-08-26java.lang.StringgetAttributeDefault(java.lang.String attributeName)Returns the Default that goes with attributeNameorg.apache.commons.lang.enums.ValuedEnumgetAttributeEnum(java.lang.String attributeName)Returns the ValuedEnum that goes with attributeNameAttributeInfo.EnumAttributeTypegetAttributeType(java.lang.String attributeName)Returns the type of the given attribute for the latest JDF version.AttributeInfo.EnumAttributeValiditygetAttributeValidity(java.lang.String attributeName)Returns the validity of the given attribute for the latest JDF version.JDFAttributeMapgetDefaultAttributeMap()Returns a map of attributes with defaults for the specified JDF version.JDFElement.EnumVersiongetFirstVersion(java.lang.String attributeName)get the first jdf version where an attrinute of this type is validJDFElement.EnumVersiongetLastVersion(java.lang.String attributeName)get the last jdf version where an attrinute of this type is validbooleanhasConformingAttrib(AttributeInfo.EnumAttributeValidity attrValidity)Returns true if there is at least one attribute matching the requested validity for the specified JDF version.VStringknownAttribs()Returns the list of all attributes for the specified JDF version.VStringoptionalAttribs()Returns the list of optional attributes for the specified JDF version.VStringprereleaseAttribs()Returns the list of prerelease attributes (those that are only valid in a later version) for the specified JDF version.VStringrequiredAttribs()Returns the list of required attributes for the specified JDF version.voidsetVersion(JDFElement.EnumVersion v)java.lang.StringtoString()AttributeInfoupdateAdd(AtrInfoTable attrInfo_update)UpdaterAttributeInfoupdateAdd(AtrInfoTable[] attrInfo_update)UpdaterAttributeInfoupdateRemove(AtrInfoTable attrInfo_update)UpdaterAttributeInfoupdateRemove(AtrInfoTable[] attrInfo_update)UpdaterAttributeInfoupdateReplace(AtrInfoTable attrInfo_update)AttributeInfoupdateReplace(AtrInfoTable[] attrInfo_update)booleanvalidAttribute(java.lang.String key, java.lang.String attribute, JDFElement.EnumValidationLevel level)static booleanvalidStringForType(java.lang.String val, AttributeInfo.EnumAttributeType iType, org.apache.commons.lang.enums.ValuedEnum enu)
-
-
-
Field Detail
-
fixedMap
public static final java.util.Map<java.lang.String,AttributeInfo> fixedMap
-
-
Constructor Detail
-
AttributeInfo
protected AttributeInfo(AtrInfoTable[] attrInfo_own)
Constructor- Parameters:
attrInfo_own- : table with element-specific attribute info
-
AttributeInfo
@Deprecated public AttributeInfo(AttributeInfo attrInfo_super, AtrInfoTable[] attrInfo_own)
Deprecated.Constructor- Parameters:
attrInfo_super- corresponding attrib info of super; if null: start from scratch, otherwise initialize from other AttributeInfoattrInfo_own- table with element-specific attribute info
-
-
Method Detail
-
updateAdd
public AttributeInfo updateAdd(AtrInfoTable attrInfo_update)
Updater- Parameters:
attrInfo_update- table with element-specific attribute info- Returns:
-
updateAdd
public AttributeInfo updateAdd(AtrInfoTable[] attrInfo_update)
Updater- Parameters:
attrInfo_update- table with element-specific attribute info- Returns:
-
updateRemove
public AttributeInfo updateRemove(AtrInfoTable attrInfo_update)
Updater- Parameters:
attrInfo_update- table with element-specific attribute info- Returns:
-
updateRemove
public AttributeInfo updateRemove(AtrInfoTable[] attrInfo_update)
Updater- Parameters:
attrInfo_update- table with element-specific attribute info to remove from attribInfoTable- Returns:
-
updateReplace
public AttributeInfo updateReplace(AtrInfoTable attrInfo_update)
- Parameters:
attrInfo_update-- Returns:
-
updateReplace
public AttributeInfo updateReplace(AtrInfoTable[] attrInfo_update)
- Parameters:
attrInfo_update-- Returns:
-
conformingAttribs
public VString conformingAttribs(AttributeInfo.EnumAttributeValidity attrValidity)
Returns a list of attributes matching the requested validity for the specified JDF version.- Parameters:
attrValidity- requested validity- Returns:
- VString: list of strings containing the names of the matching attributes
-
getDefaultAttributeMap
public JDFAttributeMap getDefaultAttributeMap()
Returns a map of attributes with defaults for the specified JDF version.- Returns:
- JDFAttributeMap: map of strings containing the names and defaults of the matching attributes, null if no defaults exist
-
hasConformingAttrib
public boolean hasConformingAttrib(AttributeInfo.EnumAttributeValidity attrValidity)
Returns true if there is at least one attribute matching the requested validity for the specified JDF version.- Parameters:
attrValidity- requested validity- Returns:
- boolean: true if at least one attribute matches the requested validity
-
requiredAttribs
public VString requiredAttribs()
Returns the list of required attributes for the specified JDF version.- Returns:
- VString: list of strings containing the names of the required attributes
-
optionalAttribs
public VString optionalAttribs()
Returns the list of optional attributes for the specified JDF version. Note: This includes attributes marked as optional as well as attributes marked as deprecated (since, for backward compatibility, these are also optional).- Returns:
- VString: list of strings containing the names of the optional attributes
-
knownAttribs
public VString knownAttribs()
Returns the list of all attributes for the specified JDF version.- Returns:
- VString: list of strings containing the names of the deprecated attributes
-
deprecatedAttribs
public VString deprecatedAttribs()
Returns the list of deprecated attributes for the specified JDF version.- Returns:
- VString: list of strings containing the names of the deprecated attributes
-
prereleaseAttribs
public VString prereleaseAttribs()
Returns the list of prerelease attributes (those that are only valid in a later version) for the specified JDF version.- Returns:
- VString: list of strings containing the names of the prerelease attributes
-
getAttributeType
public AttributeInfo.EnumAttributeType getAttributeType(java.lang.String attributeName)
Returns the type of the given attribute for the latest JDF version. Attribute types of previous versions have to be provided by attribute-specific functions (if necessary).- Parameters:
attributeName- name of the attribute- Returns:
- EnumAttributeType: the attribute's type
-
getAttributeValidity
public AttributeInfo.EnumAttributeValidity getAttributeValidity(java.lang.String attributeName)
Returns the validity of the given attribute for the latest JDF version. Attribute types of previous versions have to be provided by attribute-specific functions (if necessary).- Parameters:
attributeName- name of the attribute- Returns:
- EnumAttributeType: the attribute's type
-
getAttributeEnum
public org.apache.commons.lang.enums.ValuedEnum getAttributeEnum(java.lang.String attributeName)
Returns the ValuedEnum that goes with attributeName- Parameters:
attributeName- : name of the attribute- Returns:
- EnumAttributeType: the attribute's type
-
getAttributeDefault
public java.lang.String getAttributeDefault(java.lang.String attributeName)
Returns the Default that goes with attributeName- Parameters:
attributeName- : name of the attribute- Returns:
- EnumAttributeType: the attribute's type
-
setVersion
public void setVersion(JDFElement.EnumVersion v)
- Parameters:
v-
-
getAtrType
@Deprecated public AttributeInfo.EnumAttributeType getAtrType(java.lang.String attributeName)
Deprecated.2005-08-26returns the data type of a given attribute- Parameters:
attributeName- the localname of the attribute to check- Returns:
- the data type of attributeName
-
validAttribute
public boolean validAttribute(java.lang.String key, java.lang.String attribute, JDFElement.EnumValidationLevel level)- Parameters:
key-attribute-level-- Returns:
-
validStringForType
public static boolean validStringForType(java.lang.String val, AttributeInfo.EnumAttributeType iType, org.apache.commons.lang.enums.ValuedEnum enu)- Parameters:
val-iType-enu-- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- See Also:
Object.toString()
-
getFirstVersion
public JDFElement.EnumVersion getFirstVersion(java.lang.String attributeName)
get the first jdf version where an attrinute of this type is valid- Parameters:
attributeName- the name of the queried attribute- Returns:
-
getLastVersion
public JDFElement.EnumVersion getLastVersion(java.lang.String attributeName)
get the last jdf version where an attrinute of this type is valid- Parameters:
attributeName- the name of the queried attribute- Returns:
-
-