EclipseLink 1.0_1.0M2 API Reference - Incubation

org.eclipse.persistence.sdo
Class SDOType

java.lang.Object
  extended by org.eclipse.persistence.sdo.SDOType
All Implemented Interfaces:
java.io.Serializable

public class SDOType
extends java.lang.Object
implements java.io.Serializable

Purpose: A representation of the type of a property of a data object.

See Also:
Serialized Form

Constructor Summary
SDOType(HelperContext aContext)
           
SDOType(java.lang.String uri, java.lang.String type_name)
          INTERNAL: Build up a Type with given name and uri and a default static HelperContext.
SDOType(java.lang.String uri, java.lang.String type_name, HelperContext aContext)
          Build up a Type with given name and uri
 
Method Summary
 void addAliasName(java.lang.String name)
          INTERNAL: Assign a unique string to a type, which belongs to same uri, among types.
 void addBaseType(SDOType type)
          INTERNAL:
 void addDeclaredProperty(Property property)
          INTERNAL:
 void addDeclaredProperty(Property property, int index)
          INTERNAL:
 XMLDescriptor buildXmlDescriptor(java.util.List namespaceResolvers)
          INTERNAL:
 boolean equals(java.lang.Object object)
           
 void finishInitializeTopLink()
          INTERNAL:
 java.lang.Object get(Property property)
           
 java.util.List getAliasNames()
          Return a list of alias names for this Type.
 java.util.List getAppInfoElements()
          INTERNAL:
 java.util.Map getAppInfoMap()
          INTERNAL:
 java.util.List getBaseTypes()
          Returns the List of base Types for this Type.
 Property getChangeSummaryProperty()
          INTERNAL:
 java.util.List getDeclaredProperties()
          Returns the Properties declared in this Type as opposed to those declared in base Types.
 java.util.Map getDeclaredPropertiesMap()
          INTERNAL:
 java.lang.Class getImplClass()
          INTERNAL:
 java.lang.String getImplClassName()
          INTERNAL:
 java.lang.Class getInstanceClass()
          Returns the Java class that this type represents.
 java.lang.String getInstanceClassName()
          INTERNAL: Returns the Java class name that this type represents.
 java.util.List getInstanceProperties()
           
 java.lang.String getName()
          Returns the name of the type.
 java.util.List getNonFinalizedMappingURIs()
          INTERNAL:
 java.util.List getNonFinalizedReferencingProps()
          INTERNAL:
 java.util.List getProperties()
          Returns the List of the Properties of this type.
 Property[] getPropertiesArray()
          INTERNAL:
 Property getProperty(java.lang.String propertyName)
          Returns from all the Properties of this type, the one with the specified name.
 java.util.Map getPropertyValues()
          INTERNAL:
 java.lang.Object getPseudoDefault()
          INTERNAL: Return the wrapped initial value for the primitive numeric (when not defined) See p.45 of Java Spec 4th edition.
 java.util.List getSubTypes()
          INTERNAL:
 java.lang.String getURI()
          Returns the namespace URI of the type.
 XMLDescriptor getXmlDescriptor()
          INTERNAL: Get the XMLDescriptor associated with this Type or generate a new one.
 java.lang.String getXsdLocalName()
          INTERNAL: Returns the local name of the Property.
 javax.xml.namespace.QName getXsdType()
          INTERNAL:
 boolean isAbstract()
          Indicates if this Type is abstract.
 boolean isDataType()
          Indicates if this Type specifies DataTypes (true) or DataObjects (false).
 boolean isFinalized()
          INTERNAL:
 boolean isInstance(java.lang.Object object)
          Returns whether the specified object is an instance of this type.
 boolean isOpen()
          Indicates if this Type allows any form of open content.
 boolean isSequenced()
          Indicates if this Type specifies Sequenced DataObjects.
 boolean isXsd()
          INTERNAL: Returns if this property was declared in an XML schema.
 boolean isXsdList()
          INTERNAL: Indicates if this Type is an xsd:list in the schema
 void removeDeclaredProperties(Property p)
          INTERNAL:
 void setAbstract(boolean makeAbstract)
          INTERNAL: Change this Type's abstract setting.
 void setAliasNames(java.util.List names)
          INTERNAL: Assign a list of alias names to a type, which are unique in URI.
 void setAppInfoElements(java.util.List appInfoElementsList)
          INTERNAL:
 void setBaseTypes(java.util.List bTypes)
          INTERNAL: Set a list of Types as This Type's base Types.
 void setDataType(boolean datatype)
          INTERNAL: Set this Type to a simple Type by passing in boolean value true.
 void setFinalized(boolean bFinalized)
          INTERNAL:
 void setImplClassName(java.lang.String implClassName)
          INTERNAL:
 void setInstanceClass(java.lang.Class aClass)
          INTERNAL: Sets the Java class that this type represents.
 void setInstanceClassName(java.lang.String instanceClassName)
          INTERNAL: Sets the name of the Java class that this type represents.
 void setInstanceProperty(Property property, java.lang.Object value)
          INTERNAL:
 void setNonFinalizedMappingURIs(java.util.List nonFinalizedMappingURIsList)
          INTERNAL:
 void setNonFinalizedReferencingProps(java.util.List nonFinalizedReferencingProps)
          INTERNAL:
 void setOpen(boolean bOpen)
          INTERNAL: Make this Type an opened Type to allow open content by assigning true value or a Type not to accept any additional properties by assigning false value, isOpen().
 void setPropertyValues(java.util.Map properties)
          INTERNAL:
 void setPseudoDefault(java.lang.Object anObject)
          INTERNAL: Set an Object wrapper around primitive numeric types
 void setSequenced(boolean sequenced)
          INTERNAL: If set as true, this Type specifies Sequenced DataObjects.
 void setSubTypes(java.util.List subTypesList)
          INTERNAL:
 void setUri(java.lang.String uri)
          INTERNAL: Assign a logic uri to this Type.
 void setXmlDescriptor(XMLDescriptor anXMLDescriptor)
          INTERNAL: Set the XMLDescriptor on this Type
 void setXsd(boolean bXsd)
          INTERNAL: Set if this property was declared in an XML schema.
 void setXsdList(boolean anXsdList)
          INTERNAL: Set if this type is an xsd:list in the schema
 void setXsdLocalName(java.lang.String xsdLocalNameString)
          INTERNAL: Set the local name of this property.
 void setXsdType(javax.xml.namespace.QName xsdTypeQName)
          INTERNAL:
 void startInitializeTopLink(java.lang.String packageName, java.util.List namespaceResolvers)
          INTERNAL: For this Type generate classes
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDOType

public SDOType(HelperContext aContext)

SDOType

public SDOType(java.lang.String uri,
               java.lang.String type_name)
INTERNAL: Build up a Type with given name and uri and a default static HelperContext. Use SDOType(uri, typeName, aHelperContext) instead

Parameters:
uri - the URI of this type
type_name - the unique of this Type

SDOType

public SDOType(java.lang.String uri,
               java.lang.String type_name,
               HelperContext aContext)
Build up a Type with given name and uri

Parameters:
uri - the URI of this type
type_name - the unique of this Type
aContext - the current HelperContext
Method Detail

getName

public java.lang.String getName()
Returns the name of the type.

Returns:
the type name.

getURI

public java.lang.String getURI()
Returns the namespace URI of the type.

Returns:
the namespace URI.

getInstanceClass

public java.lang.Class getInstanceClass()
Returns the Java class that this type represents.

Returns:
the Java class.

isInstance

public boolean isInstance(java.lang.Object object)
Returns whether the specified object is an instance of this type.

Parameters:
object - the object in question.
Returns:
true if the object is an instance.
See Also:
Class.isInstance(java.lang.Object)

getProperties

public java.util.List getProperties()
Returns the List of the Properties of this type.

The expression

   type.getProperties().indexOf(property)
 
yields the property's index relative to this type. As such, these expressions are equivalent:
    dataObject.get(i)
    dataObject.get((Property)dataObject.getType().getProperties().get(i));
 

Returns:
the Properties of the type.
See Also:
Property#getContainingType

getProperty

public Property getProperty(java.lang.String propertyName)
Returns from all the Properties of this type, the one with the specified name. As such, these expressions are equivalent:
    dataObject.get("name")
    dataObject.get(dataObject.getType().getProperty("name"))
 

Returns:
the Property with the specified name.
See Also:
getProperties()

isDataType

public boolean isDataType()
Indicates if this Type specifies DataTypes (true) or DataObjects (false). When false, any object that is an instance of this type also implements the DataObject interface. True for simple types such as Strings and numbers. For any object:
   isInstance(object) && !isDataType() implies
   DataObject.class.isInstance(object) returns true.
 

Returns:
true if Type specifies DataTypes, false for DataObjects.

isOpen

public boolean isOpen()
Indicates if this Type allows any form of open content. If false, dataObject.getInstanceProperties() must be the same as dataObject.getType().getProperties() for any DataObject dataObject of this Type.

Returns:
true if this Type allows open content.

isSequenced

public boolean isSequenced()
Indicates if this Type specifies Sequenced DataObjects. Sequenced DataObjects are used when the order of values between Properties must be preserved. When true, a DataObject will return a Sequence. For example,
  Sequence elements = dataObject.getSequence();
 

Returns:
true if this Type specifies Sequenced DataObjects.

isAbstract

public boolean isAbstract()
Indicates if this Type is abstract. If true, this Type cannot be instantiated. Abstract types cannot be used in DataObject or DataFactory create methods.

Returns:
true if this Type is abstract.

getBaseTypes

public java.util.List getBaseTypes()
Returns the List of base Types for this Type. The List is empty if there are no base Types. XSD , , and Java extends keyword are mapped to this list.

Returns:
the List of base Types for this Type.

getDeclaredProperties

public java.util.List getDeclaredProperties()
Returns the Properties declared in this Type as opposed to those declared in base Types.

Returns:
the Properties declared in this Type.

getAliasNames

public java.util.List getAliasNames()
Return a list of alias names for this Type. Note: it should not be used to add alias names.

Returns:
a list of alias names for this Type.

addAliasName

public void addAliasName(java.lang.String name)
INTERNAL: Assign a unique string to a type, which belongs to same uri, among types.

Parameters:
name - a unique string representing a type.

setAliasNames

public void setAliasNames(java.util.List names)
INTERNAL: Assign a list of alias names to a type, which are unique in URI.

Parameters:
names - a unique string representing a type.

setUri

public void setUri(java.lang.String uri)
INTERNAL: Assign a logic uri to this Type.

Parameters:
uri - a logic uri of a package or target namespace.

setOpen

public void setOpen(boolean bOpen)
INTERNAL: Make this Type an opened Type to allow open content by assigning true value or a Type not to accept any additional properties by assigning false value, isOpen().

Parameters:
bOpen - boolean value implying if this Type is open

setAbstract

public void setAbstract(boolean makeAbstract)
INTERNAL: Change this Type's abstract setting. If it is true, this Type can't be instantiated and typically serve as base Type.

Parameters:
makeAbstract - boolean value implying if this Type is abstract.

setSequenced

public void setSequenced(boolean sequenced)
INTERNAL: If set as true, this Type specifies Sequenced DataObjects.

Parameters:
sequenced - boolean value implying if this type is sequenced.

setDataType

public void setDataType(boolean datatype)
INTERNAL: Set this Type to a simple Type by passing in boolean value true. Otherwise, If boolean value is passed in, instances of this type implement DataObject.

Parameters:
datatype - boolean value implying if it is a simple Type

setBaseTypes

public void setBaseTypes(java.util.List bTypes)
INTERNAL: Set a list of Types as This Type's base Types.

Parameters:
bTypes - a list types to become this Type's base Type.

addBaseType

public void addBaseType(SDOType type)
INTERNAL:

Parameters:
type - a type to become this Type's base Type.

setInstanceClass

public void setInstanceClass(java.lang.Class aClass)
INTERNAL: Sets the Java class that this type represents.

Parameters:
aClass - the Java class that this type represents.

setXsd

public void setXsd(boolean bXsd)
INTERNAL: Set if this property was declared in an XML schema.

Parameters:
bXsd - a boolean representing if this property was declared in an XML schema

isXsd

public boolean isXsd()
INTERNAL: Returns if this property was declared in an XML schema. Defaults to false.

Returns:
if this property was declared in an XML schema

setXsdLocalName

public void setXsdLocalName(java.lang.String xsdLocalNameString)
INTERNAL: Set the local name of this property.

Parameters:
xsdLocalName - a String representing the local name of this property if it was declared in an XML schema

getXsdLocalName

public java.lang.String getXsdLocalName()
INTERNAL: Returns the local name of the Property.

Returns:
the local name of the property.

addDeclaredProperty

public void addDeclaredProperty(Property property)
INTERNAL:

Parameters:
property -

addDeclaredProperty

public void addDeclaredProperty(Property property,
                                int index)
INTERNAL:

Parameters:
property -

removeDeclaredProperties

public void removeDeclaredProperties(Property p)
INTERNAL:


getDeclaredPropertiesMap

public java.util.Map getDeclaredPropertiesMap()
INTERNAL:


equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

setInstanceClassName

public void setInstanceClassName(java.lang.String instanceClassName)
INTERNAL: Sets the name of the Java class that this type represents.

Parameters:
instanceClassName - the Java class that this type represents.

getInstanceClassName

public java.lang.String getInstanceClassName()
INTERNAL: Returns the Java class name that this type represents.

Returns:
the Java class name.

setXsdList

public void setXsdList(boolean anXsdList)
INTERNAL: Set if this type is an xsd:list in the schema

Parameters:
xsdList - a boolean representing if this type represents an xsd:list in the schema

isXsdList

public boolean isXsdList()
INTERNAL: Indicates if this Type is an xsd:list in the schema

Returns:
true if this Type represents an xsd:list in the schema

setXmlDescriptor

public void setXmlDescriptor(XMLDescriptor anXMLDescriptor)
INTERNAL: Set the XMLDescriptor on this Type

Parameters:
anXMLDescriptor -

buildXmlDescriptor

public XMLDescriptor buildXmlDescriptor(java.util.List namespaceResolvers)
INTERNAL:


getXmlDescriptor

public XMLDescriptor getXmlDescriptor()
INTERNAL: Get the XMLDescriptor associated with this Type or generate a new one.


startInitializeTopLink

public void startInitializeTopLink(java.lang.String packageName,
                                   java.util.List namespaceResolvers)
INTERNAL: For this Type generate classes

Parameters:
packageName -
nr -

finishInitializeTopLink

public void finishInitializeTopLink()
INTERNAL:


setImplClassName

public void setImplClassName(java.lang.String implClassName)
INTERNAL:


getImplClassName

public java.lang.String getImplClassName()
INTERNAL:


getImplClass

public java.lang.Class getImplClass()
INTERNAL:


get

public java.lang.Object get(Property property)

getInstanceProperties

public java.util.List getInstanceProperties()

setPropertyValues

public void setPropertyValues(java.util.Map properties)
INTERNAL:


getPropertyValues

public java.util.Map getPropertyValues()
INTERNAL:


setInstanceProperty

public void setInstanceProperty(Property property,
                                java.lang.Object value)
INTERNAL:

Parameters:
property -
value -

getChangeSummaryProperty

public Property getChangeSummaryProperty()
INTERNAL:


getPropertiesArray

public Property[] getPropertiesArray()
INTERNAL:


setSubTypes

public void setSubTypes(java.util.List subTypesList)
INTERNAL:


getSubTypes

public java.util.List getSubTypes()
INTERNAL:


setXsdType

public void setXsdType(javax.xml.namespace.QName xsdTypeQName)
INTERNAL:


getXsdType

public javax.xml.namespace.QName getXsdType()
INTERNAL:


setFinalized

public void setFinalized(boolean bFinalized)
INTERNAL:


isFinalized

public boolean isFinalized()
INTERNAL:


setNonFinalizedReferencingProps

public void setNonFinalizedReferencingProps(java.util.List nonFinalizedReferencingProps)
INTERNAL:


getNonFinalizedReferencingProps

public java.util.List getNonFinalizedReferencingProps()
INTERNAL:


setNonFinalizedMappingURIs

public void setNonFinalizedMappingURIs(java.util.List nonFinalizedMappingURIsList)
INTERNAL:


getNonFinalizedMappingURIs

public java.util.List getNonFinalizedMappingURIs()
INTERNAL:


setAppInfoElements

public void setAppInfoElements(java.util.List appInfoElementsList)
INTERNAL:


getAppInfoElements

public java.util.List getAppInfoElements()
INTERNAL:


getAppInfoMap

public java.util.Map getAppInfoMap()
INTERNAL:


getPseudoDefault

public java.lang.Object getPseudoDefault()
INTERNAL: Return the wrapped initial value for the primitive numeric (when not defined) See p.45 of Java Spec 4th edition. See p.85 Sect 9.3 of the SDO Spec.

Returns:
aDefault Object (primitive numerics) or null (DataObjects, String, Lists)

setPseudoDefault

public void setPseudoDefault(java.lang.Object anObject)
INTERNAL: Set an Object wrapper around primitive numeric types

Parameters:
anObject -

EclipseLink 1.0_1.0M2 API Reference - Incubation