wt.epm.util
Class EPMAttributeConstraints

java.lang.Object
  extended bywt.epm.util.EPMAttributeConstraints
All Implemented Interfaces:
Serializable

public class EPMAttributeConstraints
extends Object
implements Serializable

Class to represent the summary of constraint of a give attribute in the type definition.

See Also:
Serialized Form

Field Summary
private  AttributeTypeIdentifier attributeType
           
private  String dataType
           
private  boolean immutable
           
private  DataSet legalValues
           
static String LOWER_CASE_CONSTRAINT
           
private  boolean lowerCase
           
private  boolean required
           
private  boolean singleValued
           
private  DiscreteSet stringFormat
           
private  AnalogSet stringLength
           
private  DiscreteSet suggestedValues
           
private  boolean upperCase
           
 
Constructor Summary
EPMAttributeConstraints(AttributeTypeIdentifier ati)
           
EPMAttributeConstraints(AttributeTypeIdentifier ati, ConstraintIdentifier[] ci, ConstraintData[] data)
           
 
Method Summary
protected  void addConstraint(ConstraintIdentifier ci, ConstraintData cn_data)
           
 AttributeTypeIdentifier getAttributeTypeIdentifier()
          Returns the AttributeTypeIdentifier for which this object contains the constraints
 String getDataType()
          Returns the data type of the attribute.
 String getExternalHid(AttributeTypeIdentifier id)
          Return the external hierarchy id from a IBA AttributeTypeIdentifier or null if it is not IBA
 DataSet getLegalValues()
          Returns the set of legal values allowed for the attribute.
 DiscreteSet getStringFormats()
          Returns the set of string formats allowed for the attribute.
 AnalogSet getStringLength()
          Returns the string length range allowed for the attribute.
 DiscreteSet getSuggestedValues()
          Returns the set of suggested values for the attribute.
 boolean isImmutable()
          Returns true if the attribute is immutable.
 boolean isLowerCase()
          Returns true if the attribute value is required to be in lower case.
 boolean isRequired()
          Returns true if the attribute is required attribute.
 boolean isSingleValued()
          Returns true if the attribute is single valued.
 boolean isUpperCase()
          Returns true if the attribute value is required to be in upper case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOWER_CASE_CONSTRAINT

public static final String LOWER_CASE_CONSTRAINT
See Also:
Constant Field Values

attributeType

private AttributeTypeIdentifier attributeType

dataType

private String dataType

legalValues

private DataSet legalValues

suggestedValues

private DiscreteSet suggestedValues

stringFormat

private DiscreteSet stringFormat

stringLength

private AnalogSet stringLength

required

private boolean required

immutable

private boolean immutable

singleValued

private boolean singleValued

upperCase

private boolean upperCase

lowerCase

private boolean lowerCase
Constructor Detail

EPMAttributeConstraints

public EPMAttributeConstraints(AttributeTypeIdentifier ati)
                        throws WTException

EPMAttributeConstraints

public EPMAttributeConstraints(AttributeTypeIdentifier ati,
                               ConstraintIdentifier[] ci,
                               ConstraintData[] data)
                        throws WTException
Method Detail

getAttributeTypeIdentifier

public AttributeTypeIdentifier getAttributeTypeIdentifier()
Returns the AttributeTypeIdentifier for which this object contains the constraints


getExternalHid

public String getExternalHid(AttributeTypeIdentifier id)
Return the external hierarchy id from a IBA AttributeTypeIdentifier or null if it is not IBA


getDataType

public String getDataType()
Returns the data type of the attribute. Returns : java.lang.Boolean for BooleanDefinition com.ptc.core.meta.common.FloatingPoint for FloatDefinition java.lang.Long for IntegerDefinition com.ptc.core.meta.common.Ratio for RatioDefinition java.lang.String for StringDefinition java.sql.Timestamp for TimestampDefinition wt.units.FloatingPointWithUnits for UnitDefinition com.ptc.core.meta.common.Hyperlink for URLDefinition


getLegalValues

public DataSet getLegalValues()
Returns the set of legal values allowed for the attribute. Returns DiscreteSet if attribute has only ENUM or both ENUM and RANGE constraints. Returns AnalogSet if attribute has only RANGE constraint. Returns null if attribute does not have ENUM or RANGE constraint


getSuggestedValues

public DiscreteSet getSuggestedValues()
Returns the set of suggested values for the attribute. Returns null if attribute does not have SUGGESTED VALUES constraint


getStringFormats

public DiscreteSet getStringFormats()
Returns the set of string formats allowed for the attribute. Returns null if attribute does not have STRING FORMAT constraint


getStringLength

public AnalogSet getStringLength()
Returns the string length range allowed for the attribute. Returns null if attribute does not have STRING LENGTH constraint


isRequired

public boolean isRequired()
Returns true if the attribute is required attribute.


isImmutable

public boolean isImmutable()
Returns true if the attribute is immutable.


isSingleValued

public boolean isSingleValued()
Returns true if the attribute is single valued.


isUpperCase

public boolean isUpperCase()
Returns true if the attribute value is required to be in upper case.


isLowerCase

public boolean isLowerCase()
Returns true if the attribute value is required to be in lower case.


addConstraint

protected void addConstraint(ConstraintIdentifier ci,
                             ConstraintData cn_data)