org.cip4.jdflib.core
Class AttributeInfo

java.lang.Object
  extended by org.cip4.jdflib.core.AttributeInfo

public class AttributeInfo
extends Object

The maintainer of version-specific attribute information: - attribute type (for current version only) - validity per version


Nested Class Summary
static class AttributeInfo.EnumAttributeType
          Enumeration of valid attribute types
static class AttributeInfo.EnumAttributeValidity
          Enumeration of attribute validity values
 
Field Summary
static HashMap<String,AttributeInfo> fixedMap
           
 
Constructor Summary
protected AttributeInfo(AtrInfoTable[] attrInfo_own)
          Constructor
  AttributeInfo(AttributeInfo attrInfo_super, AtrInfoTable[] attrInfo_own)
          Deprecated.  
 
Method Summary
 VString conformingAttribs(AttributeInfo.EnumAttributeValidity attrValidity)
          Returns a list of attributes matching the requested validity for the specified JDF version.
 VString deprecatedAttribs()
          Returns the list of deprecated attributes for the specified JDF version.
 AttributeInfo.EnumAttributeType getAtrType(String attributeName)
          Deprecated. 2005-08-26
 String getAttributeDefault(String attributeName)
          Returns the Default that goes with attributeName
 org.apache.commons.lang.enums.ValuedEnum getAttributeEnum(String attributeName)
          Returns the ValuedEnum that goes with attributeName
 AttributeInfo.EnumAttributeType getAttributeType(String attributeName)
          Returns the type of the given attribute for the latest JDF version.
 AttributeInfo.EnumAttributeValidity getAttributeValidity(String attributeName)
          Returns the validity of the given attribute for the latest JDF version.
 JDFAttributeMap getDefaultAttributeMap()
          Returns a map of attributes with defaults for the specified JDF version.
 JDFElement.EnumVersion getFirstVersion(String attributeName)
          get the first jdf version where an attrinute of this type is valid
 JDFElement.EnumVersion getLastVersion(String attributeName)
          get the last jdf version where an attrinute of this type is valid
 boolean hasConformingAttrib(AttributeInfo.EnumAttributeValidity attrValidity)
          Returns true if there is at least one attribute matching the requested validity for the specified JDF version.
 VString knownAttribs()
          Returns the list of all attributes for the specified JDF version.
 VString optionalAttribs()
          Returns the list of optional attributes for the specified JDF version.
 VString prereleaseAttribs()
          Returns the list of prerelease attributes (those that are only valid in a later version) for the specified JDF version.
 VString requiredAttribs()
          Returns the list of required attributes for the specified JDF version.
 void setVersion(JDFElement.EnumVersion v)
           
 String toString()
           
 AttributeInfo updateAdd(AtrInfoTable attrInfo_update)
          Updater
 AttributeInfo updateAdd(AtrInfoTable[] attrInfo_update)
          Updater
 AttributeInfo updateRemove(AtrInfoTable attrInfo_update)
          Updater
 AttributeInfo updateRemove(AtrInfoTable[] attrInfo_update)
          Updater
 AttributeInfo updateReplace(AtrInfoTable attrInfo_update)
           
 AttributeInfo updateReplace(AtrInfoTable[] attrInfo_update)
           
 boolean validAttribute(String key, String attribute, JDFElement.EnumValidationLevel level)
           
static boolean validStringForType(String val, AttributeInfo.EnumAttributeType iType, org.apache.commons.lang.enums.ValuedEnum enu)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fixedMap

public static HashMap<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(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(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(String attributeName)
Returns the ValuedEnum that goes with attributeName

Parameters:
attributeName - : name of the attribute
Returns:
EnumAttributeType: the attribute's type

getAttributeDefault

public String getAttributeDefault(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(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(String key,
                              String attribute,
                              JDFElement.EnumValidationLevel level)
Parameters:
key -
attribute -
level -
Returns:

validStringForType

public static boolean validStringForType(String val,
                                         AttributeInfo.EnumAttributeType iType,
                                         org.apache.commons.lang.enums.ValuedEnum enu)
Parameters:
val -
iType -
enu -
Returns:

toString

public String toString()
Overrides:
toString in class Object
Returns:
See Also:
Object.toString()

getFirstVersion

public JDFElement.EnumVersion getFirstVersion(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(String attributeName)
get the last jdf version where an attrinute of this type is valid

Parameters:
attributeName - the name of the queried attribute
Returns:


Copyright © 2013. All Rights Reserved.