edu.cmu.sei.aadl.modelsupport.properties
Class PropertyUtils

java.lang.Object
  extended by edu.cmu.sei.aadl.modelsupport.properties.PropertyUtils

public class PropertyUtils
extends java.lang.Object

This class contains static methods for assisting in getting simple property values of specific types. These methods are convenient, but they can mask errors in the specification being analyzed because they cannot distinguish between a property value being not present and a property value being modal or list-valued.

Author:
aarong

Method Summary
static EnumerationValue createEnumValue(EnumerationLiteral literal)
          Create a enumeration value from an enumeration literal.
static RangeValue createIntegerRangeValue(long min, long max)
          Creates a PropertyValue for a range of aadlinteger.
static RangeValue createIntegerRangeValue(long min, long max, long delta)
          Creates a PropertyValue for a range of aadlinteger.
static RangeValue createIntegerRangeValue(long min, UnitLiteral minUnits, long max, UnitLiteral maxUnits)
          Creates a PropertyValue for a range of aadlinteger with units.
static RangeValue createIntegerRangeValue(long min, UnitLiteral minUnits, long max, UnitLiteral maxUnits, long delta, UnitLiteral deltaUnits)
          Creates a PropertyValue for a range of aadlinteger with units.
static IntegerLiteral createIntegerValue(long intValue)
          Creates a PropertyValue for an aadlinteger.
static IntegerLiteral createIntegerValue(long intValue, UnitLiteral unit)
          Creates a PropertyValue for an aadlinteger with units.
static RangeValue createRealRangeValue(double min, double max)
          Creates a PropertyValue for a range of aadlreal.
static RangeValue createRealRangeValue(double min, double max, double delta)
          Creates a PropertyValue for a range of aadlreal.
static RangeValue createRealRangeValue(double min, UnitLiteral minUnits, double max, UnitLiteral maxUnits)
          Creates a PropertyValue for a range of aadlreal with units.
static RangeValue createRealRangeValue(double min, UnitLiteral minUnits, double max, UnitLiteral maxUnits, double delta, UnitLiteral deltaUnits)
          Creates a PropertyValue for a range of aadlreal with units.
static RealLiteral createRealValue(double realValue)
          Creates a PropertyValue for an aadlreal.
static RealLiteral createRealValue(double realValue, UnitLiteral unit)
          Creates a PropertyValue for an aadlreal with units.
static StringLiteral createStringValue(java.lang.String stringValue)
          Creates a PropertyValue for a string.
static BooleanLiteral createTrueFalseValue(boolean boolValue)
          Creates a PropertyValue for an aadlboolean.
static UnitLiteral findUnitLiteral(Property pd, java.lang.String literalname)
          Retrieve the unit literal given a unit string for a property It is useful when calling getScaledValue methods that require the literal as object
static boolean getBooleanValue(NamedElement ph, Property pd)
          Get a non-modal boolean property value.
static boolean getBooleanValue(NamedElement ph, Property pd, boolean defaultVal)
          Get a non-modal boolean property value.
static Classifier getClassifierReference(NamedElement ph, Property pd)
           
static EnumerationLiteral getEnumLiteral(NamedElement ph, Property pd)
          Get a non-modal enumeration property value.
static InstanceObject getInstanceObjectReference(InstanceObject io, Property pd)
          Get an InstanceObject from an instance reference value.
static long getIntegerValue(NamedElement ph, Property pd)
          Get a non-modal integer property value with no units.
static long getIntegerValue(NamedElement ph, Property pd, long defaultVal)
          Get a non-modal integer property value with no units.
static double getRealValue(NamedElement ph, Property pd)
          Get a non-modal real property with no units Throws an exception if no property value exists or an error occurs.
static double getRealValue(NamedElement ph, Property pd, double defaultVal)
          Get a non-modal real property value with no units.
static double getScaledNumberValue(NamedElement ph, Property pd, UnitLiteral unit)
          Get a non-modal numeric property value scaled to the given unit.
static double getScaledNumberValue(NamedElement ph, Property pd, UnitLiteral unit, double defaultVal)
          Get a non-modal numeric property value scaled to the given unit.
static double getScaledRangeDelta(NamedElement ph, Property pd, UnitLiteral unit)
          Return the delta value of a non-modal range property value scaled to a given unit.
static double getScaledRangeDelta(NamedElement ph, Property pd, UnitLiteral unit, double defaultVal)
          Return the delta value of a non-modal range property value scaled to a given unit.
static double getScaledRangeMaximum(NamedElement ph, Property pd, UnitLiteral unit)
          Return the maximum value of a non-modal range property value scaled to a given unit.
static double getScaledRangeMaximum(NamedElement ne, Property pd, UnitLiteral unit, double defaultVal)
          Return the maximum value of a non-modal range property value scaled to a given unit.
static double getScaledRangeMinimum(NamedElement ph, Property pd, UnitLiteral unit)
          Return the minimum value of a non-modal range property value scaled to a given unit.
static double getScaledRangeMinimum(NamedElement ph, Property pd, UnitLiteral unit, double defaultVal)
          Return the minimum value of a non-modal range property value scaled to a given unit.
static java.lang.String getStringValue(NamedElement ph, Property pd)
          Get a non-modal string property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIntegerValue

public static long getIntegerValue(NamedElement ph,
                                   Property pd,
                                   long defaultVal)
Get a non-modal integer property value with no units. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
defaultVal - The value to return if the property has no value.
Returns:
The integer value of the property.

getIntegerValue

public static long getIntegerValue(NamedElement ph,
                                   Property pd)
                            throws InvalidModelException,
                                   PropertyNotPresentException,
                                   PropertyIsModalException,
                                   java.lang.IllegalStateException,
                                   java.lang.IllegalArgumentException,
                                   PropertyDoesNotApplyToHolderException,
                                   PropertyIsListException,
                                   java.lang.ClassCastException
Get a non-modal integer property value with no units. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
Returns:
The integer value of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if ph or pd is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not an integer value.

getRealValue

public static double getRealValue(NamedElement ph,
                                  Property pd,
                                  double defaultVal)
Get a non-modal real property value with no units. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
defaultVal - The value to return if the property has no value.
Returns:
The real value of the property.

getRealValue

public static double getRealValue(NamedElement ph,
                                  Property pd)
                           throws InvalidModelException,
                                  PropertyNotPresentException,
                                  PropertyIsModalException,
                                  java.lang.IllegalStateException,
                                  java.lang.IllegalArgumentException,
                                  PropertyDoesNotApplyToHolderException,
                                  PropertyIsListException,
                                  java.lang.ClassCastException
Get a non-modal real property with no units Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
Returns:
The real value of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if ph or pd is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a real value.

getStringValue

public static java.lang.String getStringValue(NamedElement ph,
                                              Property pd)
Get a non-modal string property value. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
Returns:
The string value of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if ph or pd is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a string value.

getBooleanValue

public static boolean getBooleanValue(NamedElement ph,
                                      Property pd,
                                      boolean defaultVal)
Get a non-modal boolean property value. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
defaultVal - The value to return if the property has no value.
Returns:
The boolean value of the property.

getBooleanValue

public static boolean getBooleanValue(NamedElement ph,
                                      Property pd)
                               throws InvalidModelException,
                                      PropertyNotPresentException,
                                      PropertyIsModalException,
                                      java.lang.IllegalStateException,
                                      java.lang.IllegalArgumentException,
                                      PropertyDoesNotApplyToHolderException,
                                      PropertyIsListException,
                                      java.lang.ClassCastException
Get a non-modal boolean property value. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
Returns:
The boolean value of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if ph or pd is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a TrueFalseValue value.

getEnumLiteral

public static EnumerationLiteral getEnumLiteral(NamedElement ph,
                                                Property pd)
                                         throws InvalidModelException,
                                                PropertyNotPresentException,
                                                PropertyIsModalException,
                                                java.lang.IllegalStateException,
                                                java.lang.IllegalArgumentException,
                                                PropertyDoesNotApplyToHolderException,
                                                PropertyIsListException,
                                                java.lang.ClassCastException
Get a non-modal enumeration property value. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
Returns:
The enumeration literal of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if ph or pd is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not an enumeration value.

getScaledNumberValue

public static double getScaledNumberValue(NamedElement ph,
                                          Property pd,
                                          UnitLiteral unit,
                                          double defaultVal)
Get a non-modal numeric property value scaled to the given unit. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
defaultVal - The value to return if the property has no value.
Returns:
The scaled property value of the property.

getScaledNumberValue

public static double getScaledNumberValue(NamedElement ph,
                                          Property pd,
                                          UnitLiteral unit)
                                   throws InvalidModelException,
                                          PropertyNotPresentException,
                                          PropertyIsModalException,
                                          java.lang.IllegalStateException,
                                          java.lang.IllegalArgumentException,
                                          PropertyDoesNotApplyToHolderException,
                                          PropertyIsListException,
                                          java.lang.ClassCastException
Get a non-modal numeric property value scaled to the given unit. Throws an exception is no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
Returns:
The scaled property value of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if the given unit literal is not from the property's unit type or if ph, pd, or unit is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a number value.

getScaledRangeMaximum

public static double getScaledRangeMaximum(NamedElement ne,
                                           Property pd,
                                           UnitLiteral unit,
                                           double defaultVal)
Return the maximum value of a non-modal range property value scaled to a given unit. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
defaultVal - The value to return if the property has no value.
Returns:
The maximum of the range value scaled to the given unit.

getScaledRangeMaximum

public static double getScaledRangeMaximum(NamedElement ph,
                                           Property pd,
                                           UnitLiteral unit)
                                    throws InvalidModelException,
                                           PropertyNotPresentException,
                                           PropertyIsModalException,
                                           java.lang.IllegalStateException,
                                           java.lang.IllegalArgumentException,
                                           PropertyDoesNotApplyToHolderException,
                                           PropertyIsListException,
                                           java.lang.ClassCastException
Return the maximum value of a non-modal range property value scaled to a given unit. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
Returns:
The maximum of the range value scaled to the given unit.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if the given unit literal is not from the property's unit type or if ph, pd, or unit is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a range value.

getScaledRangeMinimum

public static double getScaledRangeMinimum(NamedElement ph,
                                           Property pd,
                                           UnitLiteral unit,
                                           double defaultVal)
Return the minimum value of a non-modal range property value scaled to a given unit. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
defaultVal - The value to return if the property has no value.
Returns:
The minimum of the range value scaled to the given unit.

getScaledRangeMinimum

public static double getScaledRangeMinimum(NamedElement ph,
                                           Property pd,
                                           UnitLiteral unit)
                                    throws InvalidModelException,
                                           PropertyNotPresentException,
                                           PropertyIsModalException,
                                           java.lang.IllegalStateException,
                                           java.lang.IllegalArgumentException,
                                           PropertyDoesNotApplyToHolderException,
                                           PropertyIsListException,
                                           java.lang.ClassCastException
Return the minimum value of a non-modal range property value scaled to a given unit. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
Returns:
The minimum of the range value scaled to the given unit.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if the given unit literal is not from the property's unit type or if ph, pd, or unit is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a range value.

getScaledRangeDelta

public static double getScaledRangeDelta(NamedElement ph,
                                         Property pd,
                                         UnitLiteral unit,
                                         double defaultVal)
Return the delta value of a non-modal range property value scaled to a given unit. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
defaultVal - The value to return if the property has no value.
Returns:
The delta of the range value scaled to the given unit.

getScaledRangeDelta

public static double getScaledRangeDelta(NamedElement ph,
                                         Property pd,
                                         UnitLiteral unit)
                                  throws InvalidModelException,
                                         PropertyNotPresentException,
                                         PropertyIsModalException,
                                         java.lang.IllegalStateException,
                                         java.lang.IllegalArgumentException,
                                         PropertyDoesNotApplyToHolderException,
                                         PropertyIsListException,
                                         java.lang.ClassCastException
Return the delta value of a non-modal range property value scaled to a given unit. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
Returns:
The delta of the range value scaled to the given unit.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if the given unit literal is not from the property's unit type or if ph, pd, or unit is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a range value.

getInstanceObjectReference

public static InstanceObject getInstanceObjectReference(InstanceObject io,
                                                        Property pd)
Get an InstanceObject from an instance reference value. Throws an exception if no property value exists or an error occurs.

Parameters:
io - The instance object from which to retrieve the property value. (We don't use a property holder because we can only get an instance reference value as a property value from an instance object.)
pd - The property to retrieve.
Returns:
The instance object of the property.

getClassifierReference

public static Classifier getClassifierReference(NamedElement ph,
                                                Property pd)

createIntegerValue

public static IntegerLiteral createIntegerValue(long intValue)
Creates a PropertyValue for an aadlinteger.


createIntegerValue

public static IntegerLiteral createIntegerValue(long intValue,
                                                UnitLiteral unit)
                                         throws java.lang.IllegalArgumentException
Creates a PropertyValue for an aadlinteger with units.

Throws:
java.lang.IllegalArgumentException - Thrown if unit is null.

createIntegerRangeValue

public static RangeValue createIntegerRangeValue(long min,
                                                 long max)
                                          throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlinteger.

Throws:
java.lang.IllegalArgumentException - Thrown if min is greater than max.

createIntegerRangeValue

public static RangeValue createIntegerRangeValue(long min,
                                                 UnitLiteral minUnits,
                                                 long max,
                                                 UnitLiteral maxUnits)
                                          throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlinteger with units.

Throws:
java.lang.IllegalArgumentException - Thrown if minUnits or maxUnits is null, if minUnits and maxUnits are not of the same UnitType, or if min is greater than max.

createIntegerRangeValue

public static RangeValue createIntegerRangeValue(long min,
                                                 long max,
                                                 long delta)
                                          throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlinteger.

Throws:
java.lang.IllegalArgumentException - Thrown if min is greater than max.

createIntegerRangeValue

public static RangeValue createIntegerRangeValue(long min,
                                                 UnitLiteral minUnits,
                                                 long max,
                                                 UnitLiteral maxUnits,
                                                 long delta,
                                                 UnitLiteral deltaUnits)
                                          throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlinteger with units.

Throws:
java.lang.IllegalArgumentException - Thrown if minUnits, maxUnits, or deltaUnits is null, if minUnits, maxUnits, and deltaUnits are not of the same UnitType, or if min is greater than max.

createRealValue

public static RealLiteral createRealValue(double realValue)
Creates a PropertyValue for an aadlreal.


createRealValue

public static RealLiteral createRealValue(double realValue,
                                          UnitLiteral unit)
                                   throws java.lang.IllegalArgumentException
Creates a PropertyValue for an aadlreal with units.

Throws:
java.lang.IllegalArgumentException - Thrown if unit is null.

createRealRangeValue

public static RangeValue createRealRangeValue(double min,
                                              double max)
                                       throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlreal.

Throws:
java.lang.IllegalArgumentException - Thrown if min is greater than max.

createRealRangeValue

public static RangeValue createRealRangeValue(double min,
                                              UnitLiteral minUnits,
                                              double max,
                                              UnitLiteral maxUnits)
                                       throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlreal with units.

Throws:
java.lang.IllegalArgumentException - Thrown if minUnits or maxUnits is null, if minUnits and maxUnits are not of the same UnitType, or if min is greater than max.

createRealRangeValue

public static RangeValue createRealRangeValue(double min,
                                              double max,
                                              double delta)
                                       throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlreal.

Throws:
java.lang.IllegalArgumentException - Thrown if min is greater than max.

createRealRangeValue

public static RangeValue createRealRangeValue(double min,
                                              UnitLiteral minUnits,
                                              double max,
                                              UnitLiteral maxUnits,
                                              double delta,
                                              UnitLiteral deltaUnits)
                                       throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlreal with units.

Throws:
java.lang.IllegalArgumentException - Thrown if minUnits, maxUnits, or deltaUnits is null, if minUnits, maxUnits, and deltaUnits are not of the same UnitType, or if min is greater than max.

createStringValue

public static StringLiteral createStringValue(java.lang.String stringValue)
                                       throws java.lang.IllegalArgumentException
Creates a PropertyValue for a string.

Throws:
java.lang.IllegalArgumentException - Thrown if stringValue is null.

createTrueFalseValue

public static BooleanLiteral createTrueFalseValue(boolean boolValue)
Creates a PropertyValue for an aadlboolean.


createEnumValue

public static EnumerationValue createEnumValue(EnumerationLiteral literal)
                                        throws java.lang.IllegalArgumentException
Create a enumeration value from an enumeration literal.

Parameters:
literal - The enumeration literal
Returns:
An enumeration value for the given literal
Throws:
java.lang.IllegalArgumentException - Thrown if literal is null

findUnitLiteral

public static UnitLiteral findUnitLiteral(Property pd,
                                          java.lang.String literalname)
Retrieve the unit literal given a unit string for a property It is useful when calling getScaledValue methods that require the literal as object

Parameters:
pd - Property Definition
literalname - String
Returns:
UnitLiteral or null if the unit literal could not be found or the definition does not have a unit