ecologylab.xml.types.scalar
Class KMLColorType

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.xml.types.scalar.ScalarType<KMLColor>
          extended by ecologylab.xml.types.scalar.KMLColorType

public class KMLColorType
extends ScalarType<KMLColor>

Type system entry for java.awt.Color. Uses a hex string as initialization.

Author:
andruid

Field Summary
 
Fields inherited from class ecologylab.xml.types.scalar.ScalarType
DEFAULT_DELIMS, DEFAULT_VALUE, DEFAULT_VALUE_STRING
 
Constructor Summary
KMLColorType()
          This constructor should only be called once per session, through a static initializer, typically in TypeRegistry.
 
Method Summary
 KMLColor getInstance(java.lang.String value)
          If this is a reference type, build an appropriate Object, given a String representation.
 java.lang.String marshall(KMLColor color)
          Get a String representation of the instance, using this.
 java.lang.String toString(java.lang.reflect.Field field, java.lang.Object context)
          The string representation for a Field of this type
 
Methods inherited from class ecologylab.xml.types.scalar.ScalarType
affordsInterestExpression, allowDelimitersInTokens, allowNewLines, appendValue, appendValue, appendValue, appendValue, composedOfTerms, defaultValue, defaultValueLength, defaultValueString, delimeters, getClassName, getTypeClass, illegalChars, isDefaultValue, isDefaultValue, isFloatingPoint, isPrimitive, isReference, needsEscaping, setField, setFieldError
 
Methods inherited from class ecologylab.generic.Debug
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KMLColorType

public KMLColorType()
This constructor should only be called once per session, through a static initializer, typically in TypeRegistry.

To get the instance of this type object for use in translations, call TypeRegistry.get("java.awt.Color").

Method Detail

getInstance

public KMLColor getInstance(java.lang.String value)
Description copied from class: ScalarType
If this is a reference type, build an appropriate Object, given a String representation. If it is a primitive type, return a boxed value.

Specified by:
getInstance in class ScalarType<KMLColor>
Parameters:
value - is interpreted as hex-encoded RGB value, in the same style as HTML & CSS. A # character at the start is unneccesary, but acceptable.
See Also:
ScalarType.getInstance(java.lang.String)

toString

public java.lang.String toString(java.lang.reflect.Field field,
                                 java.lang.Object context)
The string representation for a Field of this type

Overrides:
toString in class ScalarType<KMLColor>

marshall

public java.lang.String marshall(KMLColor color)
Get a String representation of the instance, using this. The default just calls the toString() method on the instance.

Overrides:
marshall in class ScalarType<KMLColor>
Parameters:
color -
Returns: