biz.c24.io.api.data
Class SimpleDataType

java.lang.Object
  extended by biz.c24.io.api.data.DataType
      extended by biz.c24.io.api.data.SimpleDataType
All Implemented Interfaces:
ModelComponent, Serializable
Direct Known Subclasses:
AtomicDataType, ListDataType, UnionDataType

public class SimpleDataType
extends DataType

A simple data type.

This is the most basic level of the structure tree.

Warning: Serialized objects of this class or of a deployed class which is derived from it may not be compatible with future releases of C24 Integreation Objects. The current serialization support is appropriate for short term storage or RMI between applications running the same version of C24 Integreation Objects.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class biz.c24.io.api.data.DataType
duringParsing, hasEnumerations, hasPatternMatching, qualifierValidation
 
Method Summary
 String formatObject(Object obj)
          Formats the supplied obj into a string.
 String formatObject(Object obj, boolean external)
          Formats the supplied obj into a string, possibly using the protected formatObjectExternal(Object) method.
protected  String formatObjectExternal(Object obj)
          Overridden by subclasses to implement special formatting of the supplied obj into a string.
static DataType getInstance()
          Returns a singleton instance.
 Object getMaxExclusive()
          Returns the maximum exclusive value (optional operation).
 Object getMaxInclusive()
          Returns the maximum inclusive value (optional operation).
 int getMaxSize()
          Returns the maximum allowable size of the value.
 Object getMinExclusive()
          Returns the minimum exclusive value (optional operation).
 Object getMinInclusive()
          Returns the minimum inclusive value (optional operation).
 int getMinSize()
          Returns the minimum allowable size of the value.
 Class getValidObjectClass()
          Returns the class of valid objects of this type.
 boolean isComplex()
          Returns whether this type is complex.
 boolean isSimple()
          Returns whether this type is simple.
 boolean isSizeFixed()
          Returns whether the size is fixed.
 Object parseObject(String str)
          Parses the supplied str into an object.
 Object parseObject(String str, boolean external)
          Parses the supplied str into an object, possibly using the protected parseObjectExternal(String, java.text.ParsePosition) method.
protected  Object parseObjectExternal(String str, ParsePosition pp)
          Overridden by subclasses to implement special parsing of the supplied str into an object The parse position is used to determine where parsing should start and to notify the calling method of where parsing finished.
 void setMaxExclusive(Object maxExclusive)
          Sets the maximum exclusive value (optional operation).
 void setMaxInclusive(Object maxInclusive)
          Sets the maximum inclusive value (optional operation).
 void setMinExclusive(Object minExclusive)
          Sets the minimum exclusive value (optional operation).
 void setMinInclusive(Object minInclusive)
          Sets the minimum inclusive value (optional operation).
 boolean validateProperties(Object object, DataComponent comp, ComplexDataObject context, ValidationManager manager)
           
 
Methods inherited from class biz.c24.io.api.data.DataType
addDerivedType, addValidator, addValidator, derivedTypeKeySet, getAnnotation, getDatabaseColumnName, getDerivedType, getDerivedType, getDerivedTypes, getDescription, getEnumeration, getInitiator, getModel, getName, getNullDefiningElementDecl, getOriginalName, getOriginalPatternMatch, getPatternMatch, getPatternType, getTerminator, getValidator, getValidatorCount, getValidatorIndex, hasDerivedTypes, isLocal, isValidObjectClass, removeDerivedType, removeValidator, setAnnotation, setDatabaseColumnName, setInitiator, setLocal, setModel, setName, setOriginalName, setOriginalPatternMatch, setPatternMatch, setPatternType, setTerminator, toString, validate, validateProperties, validateProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static DataType getInstance()
Returns a singleton instance.

Returns:
A singleton.

isComplex

public boolean isComplex()
Description copied from class: DataType
Returns whether this type is complex.

Overrides:
isComplex in class DataType
Returns:
Whether this type is complex.

isSimple

public boolean isSimple()
Description copied from class: DataType
Returns whether this type is simple. Note: a complex type can return true from this method if it is derived from a simple type.

Overrides:
isSimple in class DataType
Returns:
Whether this type is simple.

getValidObjectClass

public Class getValidObjectClass()
Description copied from class: DataType
Returns the class of valid objects of this type.

Overrides:
getValidObjectClass in class DataType
Returns:
The class.

getMinSize

public int getMinSize()
Returns the minimum allowable size of the value.

Returns:
The minimum size.

getMaxSize

public int getMaxSize()
Returns the maximum allowable size of the value.

Returns:
The maximum size or -1 if the size is unbounded.

isSizeFixed

public boolean isSizeFixed()
Returns whether the size is fixed.

Returns:
Whether == #getMaxSize().

getMaxInclusive

public Object getMaxInclusive()
Returns the maximum inclusive value (optional operation).

Returns:
The maximum inclusive value.
Throws:
UnsupportedOperationException - if this type does not represent ranged data.

setMaxInclusive

public void setMaxInclusive(Object maxInclusive)
Sets the maximum inclusive value (optional operation).

Parameters:
maxInclusive - The maximum inclusive value.
Throws:
UnsupportedOperationException - if this type does not represent ranged data.

getMinInclusive

public Object getMinInclusive()
Returns the minimum inclusive value (optional operation).

Returns:
The minimum inclusive value.
Throws:
UnsupportedOperationException - if this type does not represent ranged data.

setMinInclusive

public void setMinInclusive(Object minInclusive)
Sets the minimum inclusive value (optional operation).

Parameters:
minInclusive - The minimum inclusive value.
Throws:
UnsupportedOperationException - if this type does not represent ranged data.

getMaxExclusive

public Object getMaxExclusive()
Returns the maximum exclusive value (optional operation).

Returns:
The maximum exclusive value.
Throws:
UnsupportedOperationException - if this type does not represent ranged data.

setMaxExclusive

public void setMaxExclusive(Object maxExclusive)
Sets the maximum exclusive value (optional operation).

Parameters:
maxExclusive - The maximum exclusive value.
Throws:
UnsupportedOperationException - if this type does not represent ranged data.

getMinExclusive

public Object getMinExclusive()
Returns the minimum exclusive value (optional operation).

Returns:
The minimum exclusive value.
Throws:
UnsupportedOperationException - if this type does not represent ranged data.

setMinExclusive

public void setMinExclusive(Object minExclusive)
Sets the minimum exclusive value (optional operation).

Parameters:
minExclusive - The minimum exclusive value.
Throws:
UnsupportedOperationException - if this type does not represent ranged data.

formatObject

public String formatObject(Object obj)
Formats the supplied obj into a string.

Parameters:
obj - The object to be formatted.
Returns:
The string.

formatObject

public String formatObject(Object obj,
                           boolean external)
Formats the supplied obj into a string, possibly using the protected formatObjectExternal(Object) method.

Parameters:
obj - The object to be formatted.
external - Whether the formatObjectExternal(Object) method should be used.
Returns:
The string.

parseObject

public Object parseObject(String str)
                   throws ParserException
Parses the supplied str into an object.

Parameters:
str - The string to be parsed.
Returns:
The object.
Throws:
ParserException - If the parsing failed.

parseObject

public Object parseObject(String str,
                          boolean external)
                   throws ParserException
Parses the supplied str into an object, possibly using the protected parseObjectExternal(String, java.text.ParsePosition) method.

Parameters:
str - The string to be parsed.
external - Whether the parseObjectExternal(String, java.text.ParsePosition) method should be used.
Returns:
The object.
Throws:
ParserException - If the parsing failed.

formatObjectExternal

protected String formatObjectExternal(Object obj)
Overridden by subclasses to implement special formatting of the supplied obj into a string.

Parameters:
obj - The object to be formatter.
Returns:
The string.

parseObjectExternal

protected Object parseObjectExternal(String str,
                                     ParsePosition pp)
Overridden by subclasses to implement special parsing of the supplied str into an object The parse position is used to determine where parsing should start and to notify the calling method of where parsing finished. Note: this method does not force the parse process to use the entire input string.

Parameters:
str - The string to be parsed.
pp - The parse position
Returns:
The object.

validateProperties

public boolean validateProperties(Object object,
                                  DataComponent comp,
                                  ComplexDataObject context,
                                  ValidationManager manager)
                           throws ValidationException
Overrides:
validateProperties in class DataType
Throws:
ValidationException


C24 Technologies © 2002-2012: All Rights Reserved.