com.infoengine.schema
Class SchemaObject

java.lang.Object
  extended bycom.infoengine.schema.SchemaObject
All Implemented Interfaces:
Serializable

public class SchemaObject
extends Object
implements Serializable

Schema object container. Holds a Type object (Simple or Complex) and the Locale in which all displayable strings contained can be expected to be represented.

See Also:
Serialized Form

Field Summary
private  String locale
           
private  Type type
           
 
Constructor Summary
SchemaObject()
          Create a new empty schema object
SchemaObject(ComplexType ct)
          Create a schema object that wraps a ComplexType
SchemaObject(SimpleType st)
          Create a schema object that wraps a SimpleType
 
Method Summary
 ComplexType getComplexType()
          Get the associated ComplexType object.
 String getLocale()
          Get the locale property value
 SimpleType getSimpleType()
          Get the associated SimpleType object.
 Type getType()
          Get the enclosed Type object.
 boolean isComplex()
          Determines if this object contains a ComplexType
 boolean isSimple()
          Determines if this object contains a SimpleType
 void setComplexType(ComplexType ct)
          Set the enclosed type to a ComplexType object.
 void setLocale(String s)
          Set the locale property value
 void setSimpleType(SimpleType st)
          Set the enclosed type to a SimpleType object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locale

private String locale

type

private Type type
Constructor Detail

SchemaObject

public SchemaObject()
Create a new empty schema object


SchemaObject

public SchemaObject(SimpleType st)
Create a schema object that wraps a SimpleType

Parameters:
st - the simple type

SchemaObject

public SchemaObject(ComplexType ct)
Create a schema object that wraps a ComplexType

Parameters:
ct - the complex type
Method Detail

setLocale

public void setLocale(String s)
Set the locale property value

Parameters:
s - the new property value

getLocale

public String getLocale()
Get the locale property value

Returns:
the property value

setSimpleType

public void setSimpleType(SimpleType st)
Set the enclosed type to a SimpleType object. Since a SchemaObject may only contain either a Simple or Complex type object using this method will cause subsequent calls to getComplexType to return null.

Parameters:
st - the SimpleType object
See Also:
isSimple()

getSimpleType

public SimpleType getSimpleType()
Get the associated SimpleType object.

If the isSimple method returns true it can be expected that the output of this method will not be null.

Returns:
the SimpleType object or null if isComplex
See Also:
isSimple()

setComplexType

public void setComplexType(ComplexType ct)
Set the enclosed type to a ComplexType object. Since a SchemaObject may only contain either a Simple or Complex type object using this method will cause subsequent calls to getSimpleType to return null.

Parameters:
ct - the ComplexType object
See Also:
isComplex()

getComplexType

public ComplexType getComplexType()
Get the associated ComplexType object.

If the isComplex method returns true it can be expected that the output of this method will not be null.

Returns:
the ComplexType object or null if isSimple
See Also:
isComplex()

isSimple

public boolean isSimple()
Determines if this object contains a SimpleType

Returns:
true if this object contains a SimpleType

isComplex

public boolean isComplex()
Determines if this object contains a ComplexType

Returns:
true if this object contains a ComplexType

getType

public Type getType()
Get the enclosed Type object. May be a SimpleType, ComplexType or null.

Returns:
the Type object.