Package org.eclipse.persistence.sdo
Class SDOType
- java.lang.Object
-
- org.eclipse.persistence.sdo.SDOType
-
- All Implemented Interfaces:
Type
,Serializable
- Direct Known Subclasses:
SDOChangeSummaryType
,SDODataObjectType
,SDODataType
,SDOObjectType
,SDOOpenSequencedType
,SDOPropertyType
,SDOTypeType
,SDOWrapperType
,SDOXMLHelperLoadOptionsType
public class SDOType extends Object implements Type, Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SDOType.TypeInstantiationPolicy
-
Field Summary
Fields Modifier and Type Field Description protected HelperContext
aHelperContext
protected boolean
isDataType
protected Class
javaImplClass
protected XMLDescriptor
xmlDescriptor
-
Constructor Summary
Constructors Modifier Constructor Description SDOType(HelperContext helperContext)
SDOType(String uri, String type_name)
INTERNAL: Build up a Type with given name and uri and a default static HelperContext.SDOType(String uri, String name, SDOTypeHelper sdoTypeHelper)
Build up a Type with given name and uriprotected
SDOType(String uri, String name, SDOTypeHelper sdoTypeHelper, XMLDescriptor xmlDescriptor)
SDOType(SDOTypeHelper sdoTypeHelper)
protected
SDOType(SDOTypeHelper sdoTypeHelper, XMLDescriptor xmlDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAliasName(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:void
addDeclaredProperty(SDOProperty property)
INTERNAL:void
addDeclaredProperty(SDOProperty property, int index)
INTERNAL:Object
get(Property property)
Returns the value of the specified instance property of this Type.List
getAliasNames()
Return a list of alias names for this Type.List
getAppInfoElements()
INTERNAL:Map
getAppInfoMap()
INTERNAL:List
getBaseTypes()
Returns the List of base Types for this Type.SDOProperty
getChangeSummaryProperty()
INTERNAL:List
getDeclaredProperties()
Returns the Properties declared in this Type as opposed to those declared in base Types.Map
getDeclaredPropertiesMap()
INTERNAL:HelperContext
getHelperContext()
Return the HelperContext object associated with this type.Class
getImplClass()
INTERNAL:String
getImplClassName()
INTERNAL:Class
getInstanceClass()
Returns the Java class that this type represents.String
getInstanceClassName()
INTERNAL: Returns the Java class name that this type represents.List
getInstanceProperties()
Returns a read-only List of instance Properties available on this Type.String
getName()
Returns the name of the type.List
getNonFinalizedMappingURIs()
INTERNAL:List
getNonFinalizedReferencingProps()
INTERNAL:List
getProperties()
Returns the List of theProperties
of this type.SDOProperty[]
getPropertiesArray()
INTERNAL:SDOProperty
getProperty(String propertyName)
Returns fromall the Properties
of this type, the one with the specified name.Map
getPropertyValues()
INTERNAL:Object
getPseudoDefault()
INTERNAL: Return the wrapped initial value for the primitive numeric (when not defined) See p.45 of Java Spec 4th edition.QName
getQName()
List
getSubTypes()
INTERNAL:String
getURI()
Returns the namespace URI of the type ornull
if the type has no URI (for example it was generated from a Schema with no target namespace).XMLDescriptor
getXmlDescriptor()
String
getXsdLocalName()
INTERNAL: Returns the local name of the Property.QName
getXsdType()
INTERNAL:void
initializeNamespaces(List namespaceResolvers)
INTERNAL: Get the XMLDescriptor associated with this Type or generate a new one.boolean
isAbstract()
Indicates if this Type is abstract.boolean
isBaseType()
INTERNAL: Provide a means to determine if this type has sub types without causing the sub types property to be initialized.boolean
isChangeSummaryType()
boolean
isDataObjectType()
boolean
isDataType()
Indicates if this Type specifies DataTypes (true) or DataObjects (false).boolean
isFinalized()
INTERNAL:boolean
isInstance(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
isOpenSequencedType()
boolean
isSequenced()
Indicates if this Type specifies Sequenced DataObjects.boolean
isSubType()
INTERNAL: Provide a means to determine if this type has base types without causing the base types property to be initialized.boolean
isTypeType()
boolean
isWrapperType()
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 schemavoid
postInitialize()
INTERNAL:void
preInitialize(String packageName, List namespaceResolvers)
INTERNAL: For this Type generate classesvoid
removeDeclaredProperties(Property p)
INTERNAL:void
setAbstract(boolean makeAbstract)
INTERNAL: Change this Type's abstract setting.void
setAliasNames(List names)
INTERNAL: Assign a list of alias names to a type, which are unique in URI.void
setAppInfoElements(List appInfoElementsList)
INTERNAL:void
setBaseTypes(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(String implClassName)
INTERNAL:void
setInstanceClass(Class aClass)
INTERNAL: Sets the Java class that this type represents.void
setInstanceClassName(String instanceClassName)
INTERNAL: Sets the name of the Java class that this type represents.void
setInstanceProperty(Property property, Object value)
INTERNAL:void
setMixed(boolean isMixed)
void
setNonFinalizedMappingURIs(List nonFinalizedMappingURIsList)
INTERNAL:void
setNonFinalizedReferencingProps(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(Map properties)
INTERNAL:void
setPseudoDefault(Object anObject)
INTERNAL: Set an Object wrapper around primitive numeric typesvoid
setQName(QName qName)
void
setSequenced(boolean sequenced)
INTERNAL: If set as true, this Type specifies Sequenced DataObjects.void
setSubTypes(List subTypesList)
INTERNAL:void
setupInheritance(SDOType parentType)
void
setXmlDescriptor(XMLDescriptor anXMLDescriptor)
INTERNAL: Set the XMLDescriptor on this Typevoid
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 schemavoid
setXsdLocalName(String xsdLocalNameString)
INTERNAL: Set the local name of this property.void
setXsdType(QName xsdTypeQName)
INTERNAL:
-
-
-
Field Detail
-
isDataType
protected boolean isDataType
-
xmlDescriptor
protected transient XMLDescriptor xmlDescriptor
-
javaImplClass
protected Class javaImplClass
-
aHelperContext
protected HelperContext aHelperContext
-
-
Constructor Detail
-
SDOType
public SDOType(HelperContext helperContext)
-
SDOType
public SDOType(SDOTypeHelper sdoTypeHelper)
-
SDOType
protected SDOType(SDOTypeHelper sdoTypeHelper, XMLDescriptor xmlDescriptor)
-
SDOType
public SDOType(String uri, String type_name)
INTERNAL: Build up a Type with given name and uri and a default static HelperContext. UseSDOType(String, String, org.eclipse.persistence.sdo.helper.SDOTypeHelper)
instead- Parameters:
uri
- the URI of this typetype_name
- the unique of this Type
-
SDOType
public SDOType(String uri, String name, SDOTypeHelper sdoTypeHelper)
Build up a Type with given name and uri- Parameters:
uri
- the URI of this typename
- the unique of this TypesdoTypeHelper
- the current HelperContext
-
SDOType
protected SDOType(String uri, String name, SDOTypeHelper sdoTypeHelper, XMLDescriptor xmlDescriptor)
-
-
Method Detail
-
getQName
public QName getQName()
-
setQName
public void setQName(QName qName)
-
getName
public String getName()
Description copied from interface:Type
Returns the name of the type.
-
getURI
public String getURI()
Description copied from interface:Type
Returns the namespace URI of the type ornull
if the type has no URI (for example it was generated from a Schema with no target namespace).
-
getInstanceClass
public Class getInstanceClass()
Description copied from interface:Type
Returns the Java class that this type represents.- Specified by:
getInstanceClass
in interfaceType
- Returns:
- the Java class.
-
isInstance
public boolean isInstance(Object object)
Description copied from interface:Type
Returns whether the specified object is an instance of this type.- Specified by:
isInstance
in interfaceType
- Parameters:
object
- the object in question.- Returns:
true
if the object is an instance.- See Also:
Class.isInstance(java.lang.Object)
-
getProperties
public List getProperties()
Description copied from interface:Type
Returns the List of theProperties
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));- Specified by:
getProperties
in interfaceType
- Returns:
- the Properties of the type.
- See Also:
Property.getContainingType()
-
getProperty
public SDOProperty getProperty(String propertyName)
Description copied from interface:Type
Returns fromall 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"))- Specified by:
getProperty
in interfaceType
- Returns:
- the Property with the specified name.
- See Also:
Type.getProperties()
-
isDataType
public boolean isDataType()
Description copied from interface:Type
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.
- Specified by:
isDataType
in interfaceType
- Returns:
- true if Type specifies DataTypes, false for DataObjects.
-
isOpen
public boolean isOpen()
Description copied from interface:Type
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.
-
isSequenced
public boolean isSequenced()
Description copied from interface:Type
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
();- Specified by:
isSequenced
in interfaceType
- Returns:
- true if this Type specifies Sequenced DataObjects.
-
isAbstract
public boolean isAbstract()
Description copied from interface:Type
Indicates if this Type is abstract. If true, this Type cannot be instantiated. Abstract types cannot be used in DataObject or DataFactory create methods.- Specified by:
isAbstract
in interfaceType
- Returns:
- true if this Type is abstract.
-
getBaseTypes
public List getBaseTypes()
Description copied from interface:Type
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. - Specified by:
getBaseTypes
in interfaceType
- Returns:
- the List of base Types for this Type.
-
isSubType
public boolean isSubType()
INTERNAL: Provide a means to determine if this type has base types without causing the base types property to be initialized.
-
getDeclaredProperties
public List getDeclaredProperties()
Description copied from interface:Type
Returns the Properties declared in this Type as opposed to those declared in base Types.- Specified by:
getDeclaredProperties
in interfaceType
- Returns:
- the Properties declared in this Type.
-
getAliasNames
public List getAliasNames()
Description copied from interface:Type
Return a list of alias names for this Type.- Specified by:
getAliasNames
in interfaceType
- Returns:
- a list of alias names for this Type.
-
addAliasName
public void addAliasName(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(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.
-
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.
-
setMixed
public void setMixed(boolean isMixed)
-
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(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(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(String xsdLocalNameString)
INTERNAL: Set the local name of this property.- Parameters:
xsdLocalNameString
- a String representing the local name of this property if it was declared in an XML schema
-
getXsdLocalName
public 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(SDOProperty property)
INTERNAL:- Parameters:
property
-
-
addDeclaredProperty
public void addDeclaredProperty(Property property, int index)
INTERNAL:- Parameters:
property
-
-
addDeclaredProperty
public void addDeclaredProperty(SDOProperty property, int index)
INTERNAL:- Parameters:
property
-
-
removeDeclaredProperties
public void removeDeclaredProperties(Property p)
INTERNAL:
-
getDeclaredPropertiesMap
public Map getDeclaredPropertiesMap()
INTERNAL:
-
setInstanceClassName
public void setInstanceClassName(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 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:
anXsdList
- 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
-
-
getXmlDescriptor
public XMLDescriptor getXmlDescriptor()
-
initializeNamespaces
public void initializeNamespaces(List namespaceResolvers)
INTERNAL: Get the XMLDescriptor associated with this Type or generate a new one.
-
setupInheritance
public void setupInheritance(SDOType parentType)
-
preInitialize
public void preInitialize(String packageName, List namespaceResolvers)
INTERNAL: For this Type generate classes- Parameters:
packageName
-namespaceResolvers
-
-
postInitialize
public void postInitialize()
INTERNAL:
-
setImplClassName
public void setImplClassName(String implClassName)
INTERNAL:
-
getImplClassName
public String getImplClassName()
INTERNAL:
-
getImplClass
public Class getImplClass()
INTERNAL:
-
get
public Object get(Property property)
Description copied from interface:Type
Returns the value of the specified instance property of this Type.- Specified by:
get
in interfaceType
- Parameters:
property
- one of the properties returned byType.getInstanceProperties()
.- Returns:
- the value of the specified property.
- See Also:
DataObject.get(Property)
-
getInstanceProperties
public List getInstanceProperties()
Description copied from interface:Type
Returns a read-only List of instance Properties available on this Type.This list includes, at a minimum, any open content properties (extensions) added to the object before
defining the Type's Type
. Implementations may, but are not required to in the 2.1 version of SDO, provide additional instance properties.- Specified by:
getInstanceProperties
in interfaceType
- Returns:
- the List of instance Properties on this Type.
-
setPropertyValues
public void setPropertyValues(Map properties)
INTERNAL:
-
getPropertyValues
public Map getPropertyValues()
INTERNAL:
-
setInstanceProperty
public void setInstanceProperty(Property property, Object value)
INTERNAL:- Parameters:
property
-value
-
-
getChangeSummaryProperty
public SDOProperty getChangeSummaryProperty()
INTERNAL:
-
getPropertiesArray
public SDOProperty[] getPropertiesArray()
INTERNAL:
-
setSubTypes
public void setSubTypes(List subTypesList)
INTERNAL:
-
getSubTypes
public List getSubTypes()
INTERNAL:
-
isBaseType
public boolean isBaseType()
INTERNAL: Provide a means to determine if this type has sub types without causing the sub types property to be initialized.
-
setXsdType
public void setXsdType(QName xsdTypeQName)
INTERNAL:
-
getXsdType
public QName getXsdType()
INTERNAL:
-
setFinalized
public void setFinalized(boolean bFinalized)
INTERNAL:
-
isFinalized
public boolean isFinalized()
INTERNAL:
-
setNonFinalizedReferencingProps
public void setNonFinalizedReferencingProps(List nonFinalizedReferencingProps)
INTERNAL:
-
getNonFinalizedReferencingProps
public List getNonFinalizedReferencingProps()
INTERNAL:
-
setNonFinalizedMappingURIs
public void setNonFinalizedMappingURIs(List nonFinalizedMappingURIsList)
INTERNAL:
-
getNonFinalizedMappingURIs
public List getNonFinalizedMappingURIs()
INTERNAL:
-
setAppInfoElements
public void setAppInfoElements(List appInfoElementsList)
INTERNAL:
-
getAppInfoElements
public List getAppInfoElements()
INTERNAL:
-
getAppInfoMap
public Map getAppInfoMap()
INTERNAL:
-
getPseudoDefault
public 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(Object anObject)
INTERNAL: Set an Object wrapper around primitive numeric types- Parameters:
anObject
-
-
getHelperContext
public HelperContext getHelperContext()
Return the HelperContext object associated with this type. For example, the typeHelper associated with the returned HelperContext would contain this type
-
isChangeSummaryType
public boolean isChangeSummaryType()
-
isDataObjectType
public boolean isDataObjectType()
-
isTypeType
public boolean isTypeType()
-
isOpenSequencedType
public boolean isOpenSequencedType()
-
isWrapperType
public boolean isWrapperType()
-
-