org.quattor.pan.dml.data
Class StringProperty

java.lang.Object
  extended by org.quattor.pan.dml.data.Element
      extended by org.quattor.pan.dml.data.PersistentElement
          extended by org.quattor.pan.dml.data.Property
              extended by org.quattor.pan.dml.data.StringProperty
All Implemented Interfaces:
java.lang.Comparable<Term>, Operation, Term

@Immutable
public class StringProperty
extends Property
implements Term

Represents a string value. This class implements the Term interface; instances of this class can be used to dereference Resources.

Author:
loomis

Constructor Summary
protected StringProperty(java.lang.String value)
           
 
Method Summary
 void checkRange(Range range)
          Determine if the element satisfies the given range constraint.
 int compareTo(Term o)
           
 java.lang.Integer getIndex()
          Method to extract the Integer index for this Term.
static StringProperty getInstance(java.lang.String value)
           
 java.lang.String getKey()
          Method to extract the String key for this Term.
 java.lang.String getTypeAsString()
          All Elements must return a string describing its type.
 java.lang.String getValue()
          Return the value of this property as an Object.
 boolean isKey()
          A utility function to determine if this Term is a key (String value).
 
Methods inherited from class org.quattor.pan.dml.data.Property
equals, hashCode, toString
 
Methods inherited from class org.quattor.pan.dml.data.Element
checkInvalidSelfContext, checkRestrictedContext, checkValidReplacement, defined, duplicate, execute, exists, isBoolean, isDouble, isList, isLong, isNlist, isPersistent, isProperty, isProtected, isResource, isString, isTransient, locateUndefinedElement, protect, rget, rgetList, rput, writableCopy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.quattor.pan.utils.Term
equals, hashCode, toString
 

Constructor Detail

StringProperty

protected StringProperty(java.lang.String value)
Method Detail

getInstance

public static StringProperty getInstance(java.lang.String value)

checkRange

public void checkRange(Range range)
                throws ValidationException
Description copied from class: Element
Determine if the element satisfies the given range constraint. This is used in the validation of the element. By default, this method with throw a ValidationException indicating that range checking of this element is not appropriate.

Overrides:
checkRange in class Element
Parameters:
range - Range to check Element against
Throws:
ValidationException - if the element cannot be compared to a range or if the element doesn't meet the range requirement

getValue

public java.lang.String getValue()
Description copied from class: Property
Return the value of this property as an Object. Subclasses may override this method to provide a more specific return type. Subclasses will have to call this method to obtain the value because the value itself is private.

Overrides:
getValue in class Property
Returns:
value of this property as an Object

getTypeAsString

public java.lang.String getTypeAsString()
Description copied from class: Element
All Elements must return a string describing its type. This value used in the serialization to machine profiles.

Specified by:
getTypeAsString in class Element
Returns:
String representation of Element's type

isKey

public boolean isKey()
Description copied from interface: Term
A utility function to determine if this Term is a key (String value).

Specified by:
isKey in interface Term
Returns:
boolean indicating if this Term is a key

getIndex

public java.lang.Integer getIndex()
                           throws InvalidTermException
Description copied from interface: Term
Method to extract the Integer index for this Term. This will throw an exception if the Term is not an index.

Specified by:
getIndex in interface Term
Returns:
Integer index of the Term
Throws:
InvalidTermException - thrown if the term is not an index; message should contain the string value of the term that was used

getKey

public java.lang.String getKey()
                        throws InvalidTermException
Description copied from interface: Term
Method to extract the String key for this Term. This will throw an exception if the Term is not a key.

Specified by:
getKey in interface Term
Returns:
String key of the Term
Throws:
InvalidTermException - thrown if the term is not a key; message should contain the string value of the term that was used

compareTo

public int compareTo(Term o)
Specified by:
compareTo in interface java.lang.Comparable<Term>


Copyright © 2011 Quattor. All Rights Reserved.