Class AttributeInfo


  • public class AttributeInfo
    extends java.lang.Object
    The maintainer of version-specific attribute information: - attribute type (for current version only) - validity per version
    • 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 AttributeInfo
        attrInfo_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
      • getAtrType

        @Deprecated
        public AttributeInfo.EnumAttributeType getAtrType​(java.lang.String attributeName)
        Deprecated.
        2005-08-26
        returns 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:
        toString in class java.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: