Package org.eclipse.persistence.sdo
Class SDOProperty
- java.lang.Object
-
- org.eclipse.persistence.sdo.SDOProperty
-
- All Implemented Interfaces:
commonj.sdo.Property,java.io.Serializable
public class SDOProperty extends java.lang.Object implements commonj.sdo.Property, java.io.SerializablePurpose:A representation of a Property in the
typeof adata object.Responsibilities:
- A property represents an element or attribute in XML
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SDOProperty(commonj.sdo.helper.HelperContext aContext)SDOProperty(commonj.sdo.helper.HelperContext aContext, java.lang.String aName)SDOProperty(commonj.sdo.helper.HelperContext aContext, java.lang.String aUri, java.lang.String aName, SDOType aType)SDOProperty(commonj.sdo.helper.HelperContext aContext, java.lang.String aName, SDOType aType)SDOProperty(commonj.sdo.helper.HelperContext aContext, java.lang.String aName, SDOType aType, boolean hasMany)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMappingToOwner(boolean sdoMethodAttributeAccessor, int indexToAdd)INTERNAL:voidbuildChangeSummaryMapping()INTERNAL:voidbuildMapping(java.lang.String mappingUri)INTERNAL:voidbuildMapping(java.lang.String mappingUri, int indexToAdd)INTERNAL:org.eclipse.persistence.oxm.mappings.XMLFragmentCollectionMappingbuildXMLFragmentCollectionMapping(java.lang.String mappingUri)org.eclipse.persistence.oxm.mappings.XMLFragmentMappingbuildXMLFragmentMapping(java.lang.String uri)booleanequals(java.lang.Object obj)Indicate if a given SDOProperty instance is equal to this instance.java.lang.Objectget(commonj.sdo.Property property)java.util.ListgetAliasNames()Return a list of alias names for this Property.java.util.ListgetAppInfoElements()INTERNAL:java.util.MapgetAppInfoMap()INTERNAL:SDOTypegetContainingType()Returns the containing type of this Property.java.lang.ObjectgetDefault()Returns the default value this Property will have in adata objectwhere the Property hasn't been set.intgetIndexInDeclaredProperties()INTERNAL:intgetIndexInType()INTERNAL:java.util.ListgetInstanceProperties()org.eclipse.persistence.oxm.mappings.MimeTypePolicygetMimeTypePolicy()INTERNAL:java.lang.StringgetName()Returns the name of the Property.SDOPropertygetOpposite()Returns the opposite Property if the Property is bi-directional or null otherwise.java.util.MapgetPropertyValues()INTERNAL:java.lang.StringgetQualifiedXPath(java.lang.String uri, boolean simple)INTERNAL:java.util.Collection<SDOProperty>getSubstitutableElements()SDOTypegetType()Returns the type of the Property.java.lang.StringgetUri()org.eclipse.persistence.mappings.DatabaseMappinggetXmlMapping()INTERNAL:java.lang.StringgetXPath()INTERNAL:java.lang.StringgetXsdLocalName()INTERNAL: Returns the local name of the Property.javax.xml.namespace.QNamegetXsdType()INTERNAL:booleanhasAliasNames()inthashCode()Return a unique hashCode (as an int) for this instance.voidincrementIndexInType()INTERNAL:booleanisContainment()Returns whether the Property is containment, i.e., whether it represents by-value composition.booleanisDefaultSet()INTERNAL: Return whether the default value has been set by the schema either via a define by an XSD or a DataObject.protected java.lang.BooleanisElement()INTERNAL: Return true if the property is an element, false if the property is an attribute, and null if it has not been specified.booleanisFinalized()booleanisGlobal()INTERNAL:booleanisMany()Returns whether the Property is many-valued.booleanisNameCollision()booleanisNamespaceQualified()INTERNAL: Returns if the element or attribute corresponding to this Property should be namespace qualified in the XSD.booleanisNullable()booleanisOpenContent()Return whether or not this is an open content property.booleanisReadOnly()Returns true if values for this Property cannot be modified using the SDO APIs.booleanisSubstitutable()booleanisValueProperty()INTERNAL:booleanisXsd()INTERNAL: Returns if this property was declared in an XML schema.voidsetAliasNames(java.util.List names)INTERNAL: Set this Property's alias name list which are unique within the Type.voidsetAppInfoElements(java.util.List appInfoElements)INTERNAL:voidsetContainingType(commonj.sdo.Type type)INTERNAL: Set the containing type of this Property.voidsetContainment(boolean containment)INTERNAL: Set this Property's Containment which shows parent-child relationship in a tree of DataObjects.voidsetDefault(java.lang.Object aDefaultValue)INTERNAL: Set the default value of this Property.voidsetFinalized(boolean isFinalized)voidsetGlobal(boolean global)INTERNAL:voidsetIndexInDeclaredProperties(int indexInDeclaredProperties)INTERNAL:voidsetIndexInType(int indexInType)INTERNAL:voidsetInstanceProperty(commonj.sdo.Property property, java.lang.Object value)voidsetMany(boolean many)INTERNAL: Set this property as single-valued(false) or many-valued(true).voidsetName(java.lang.String name)INTERNAL: Assign a string as a unique name of this Property among Properties that belongs to a DataObject.voidsetNameCollision(boolean nameCollision)voidsetNamespaceQualified(boolean namespaceQualified)INTERNAL: Set if the element or attribute corresponding to this Property is namespace qualified in the XSD.voidsetNullable(boolean nullable)INTERNAL:voidsetOpposite(commonj.sdo.Property property)INTERNAL: Set the opposite Property.voidsetPropertyValues(java.util.Map properties)INTERNAL:voidsetReadOnly(boolean readOnly)INTERNAL: Set this Property as read-only Property.voidsetSubstitutable(boolean substitutable)voidsetSubstitutableElements(java.util.Collection<SDOProperty> elements)voidsetType(commonj.sdo.Type type)INTERNAL: Assign a Type to this Property.voidsetUri(java.lang.String uri)voidsetValueProperty(boolean valueProperty)INTERNAL:voidsetXmlMapping(org.eclipse.persistence.mappings.DatabaseMapping xmlMapping)INTERNAL:voidsetXsd(boolean xsd)INTERNAL: Set if this property was declared in an XML schema.voidsetXsdLocalName(java.lang.String xsdLocalName)INTERNAL: Set the local name of this property.voidsetXsdType(javax.xml.namespace.QName xsdType)INTERNAL:
-
-
-
Constructor Detail
-
SDOProperty
public SDOProperty(commonj.sdo.helper.HelperContext aContext)
-
SDOProperty
public SDOProperty(commonj.sdo.helper.HelperContext aContext, java.lang.String aName)
-
SDOProperty
public SDOProperty(commonj.sdo.helper.HelperContext aContext, java.lang.String aName, SDOType aType)
-
SDOProperty
public SDOProperty(commonj.sdo.helper.HelperContext aContext, java.lang.String aName, SDOType aType, boolean hasMany)
-
SDOProperty
public SDOProperty(commonj.sdo.helper.HelperContext aContext, java.lang.String aUri, java.lang.String aName, SDOType aType)
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the Property.- Specified by:
getNamein interfacecommonj.sdo.Property- Returns:
- the Property name.
-
getType
public SDOType getType()
Returns the type of the Property.- Specified by:
getTypein interfacecommonj.sdo.Property- Returns:
- the Property type.
-
isMany
public boolean isMany()
Returns whether the Property is many-valued.- Specified by:
isManyin interfacecommonj.sdo.Property- Returns:
trueif the Property is many-valued.
-
isOpenContent
public boolean isOpenContent()
Return whether or not this is an open content property.- Specified by:
isOpenContentin interfacecommonj.sdo.Property- Returns:
- true if this property is an open content property.
-
isContainment
public boolean isContainment()
Returns whether the Property is containment, i.e., whether it represents by-value composition.- Specified by:
isContainmentin interfacecommonj.sdo.Property- Returns:
trueif the Property is containment.
-
getContainingType
public SDOType getContainingType()
Returns the containing type of this Property.- Specified by:
getContainingTypein interfacecommonj.sdo.Property- Returns:
- the Property's containing type.
- See Also:
Type.getProperties()
-
getDefault
public java.lang.Object getDefault()
Returns the default value this Property will have in adata objectwhere the Property hasn't been set.- Specified by:
getDefaultin interfacecommonj.sdo.Property- Returns:
- the default value.
-
isReadOnly
public boolean isReadOnly()
Returns true if values for this Property cannot be modified using the SDO APIs. When true, DataObject.set(Property property, Object value) throws an exception. Values may change due to other factors, such as services operating on DataObjects.- Specified by:
isReadOnlyin interfacecommonj.sdo.Property- Returns:
- true if values for this Property cannot be modified.
-
getOpposite
public SDOProperty getOpposite()
Returns the opposite Property if the Property is bi-directional or null otherwise.- Specified by:
getOppositein interfacecommonj.sdo.Property- Returns:
- the opposite Property if the Property is bi-directional or null
-
hasAliasNames
public boolean hasAliasNames()
-
getAliasNames
public java.util.List getAliasNames()
Return a list of alias names for this Property.- Specified by:
getAliasNamesin interfacecommonj.sdo.Property- Returns:
- a list of alias names for this Property.
-
setName
public void setName(java.lang.String name)
INTERNAL: Assign a string as a unique name of this Property among Properties that belongs to a DataObject.- Parameters:
name- a string representing unique name of a property of a DataObject.
-
setType
public void setType(commonj.sdo.Type type)
INTERNAL: Assign a Type to this Property.- Parameters:
type- the type of this property.
-
setContainment
public void setContainment(boolean containment)
INTERNAL: Set this Property's Containment which shows parent-child relationship in a tree of DataObjects.- Parameters:
containment- a boolean value showing if this Property is containment.
-
setMany
public void setMany(boolean many)
INTERNAL: Set this property as single-valued(false) or many-valued(true). Default is false.- Parameters:
many- a boolean value if this property is many-valued or not.
-
setReadOnly
public void setReadOnly(boolean readOnly)
INTERNAL: Set this Property as read-only Property.- Parameters:
readOnly- boolean value implying this Property is readonly.
-
setAliasNames
public void setAliasNames(java.util.List names)
INTERNAL: Set this Property's alias name list which are unique within the Type.- Parameters:
names- a list of alias name of this Property.
-
setContainingType
public void setContainingType(commonj.sdo.Type type)
INTERNAL: Set the containing type of this Property.- Parameters:
type- a Type which is the containing type of this Property
-
setDefault
public void setDefault(java.lang.Object aDefaultValue)
INTERNAL: Set the default value of this Property.- Parameters:
aDefaultValue- an Object to be the default value of this type.
-
setOpposite
public void setOpposite(commonj.sdo.Property property)
INTERNAL: Set the opposite Property. If not null then this Property is a of a bi-directional Property.- Parameters:
property- the opposite Property if the Property is bi-directional, otherwise null
-
setXsd
public void setXsd(boolean xsd)
INTERNAL: Set if this property was declared in an XML schema.- Parameters:
xsd- 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 xsdLocalName)
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.
-
setNamespaceQualified
public void setNamespaceQualified(boolean namespaceQualified)
INTERNAL: Set if the element or attribute corresponding to this Property is namespace qualified in the XSD.- Parameters:
namespaceQualified- a boolean representing if the element or attribute corresponding to this Property is namespace qualified in the XSD.
-
isNamespaceQualified
public boolean isNamespaceQualified()
INTERNAL: Returns if the element or attribute corresponding to this Property should be namespace qualified in the XSD.- Returns:
- if the element or attribute corresponding to this Property should be namespace qualified in the XSD.
-
setXmlMapping
public void setXmlMapping(org.eclipse.persistence.mappings.DatabaseMapping xmlMapping)
INTERNAL:
-
getXmlMapping
public org.eclipse.persistence.mappings.DatabaseMapping getXmlMapping()
INTERNAL:
-
setGlobal
public void setGlobal(boolean global)
INTERNAL:
-
isGlobal
public boolean isGlobal()
INTERNAL:
-
isElement
protected java.lang.Boolean isElement()
INTERNAL: Return true if the property is an element, false if the property is an attribute, and null if it has not been specified. This property has been added as a performance optimization to reduce the number of Maps created for the propertyValues property.
-
buildMapping
public void buildMapping(java.lang.String mappingUri)
INTERNAL:
-
buildMapping
public void buildMapping(java.lang.String mappingUri, int indexToAdd)INTERNAL:
-
buildChangeSummaryMapping
public void buildChangeSummaryMapping()
INTERNAL:
-
addMappingToOwner
public void addMappingToOwner(boolean sdoMethodAttributeAccessor, int indexToAdd)INTERNAL:
-
getXPath
public java.lang.String getXPath()
INTERNAL:
-
getQualifiedXPath
public java.lang.String getQualifiedXPath(java.lang.String uri, boolean simple)INTERNAL:
-
get
public java.lang.Object get(commonj.sdo.Property property)
- Specified by:
getin interfacecommonj.sdo.Property
-
getInstanceProperties
public java.util.List getInstanceProperties()
- Specified by:
getInstancePropertiesin interfacecommonj.sdo.Property
-
setPropertyValues
public void setPropertyValues(java.util.Map properties)
INTERNAL:
-
getPropertyValues
public java.util.Map getPropertyValues()
INTERNAL:
-
setInstanceProperty
public void setInstanceProperty(commonj.sdo.Property property, java.lang.Object value)
-
setIndexInType
public void setIndexInType(int indexInType)
INTERNAL:
-
getIndexInType
public int getIndexInType()
INTERNAL:
-
incrementIndexInType
public void incrementIndexInType()
INTERNAL:
-
setNullable
public void setNullable(boolean nullable)
INTERNAL:
-
isNullable
public boolean isNullable()
- Specified by:
isNullablein interfacecommonj.sdo.Property
-
setXsdType
public void setXsdType(javax.xml.namespace.QName xsdType)
INTERNAL:
-
getXsdType
public javax.xml.namespace.QName getXsdType()
INTERNAL:
-
getMimeTypePolicy
public org.eclipse.persistence.oxm.mappings.MimeTypePolicy getMimeTypePolicy()
INTERNAL:
-
setIndexInDeclaredProperties
public void setIndexInDeclaredProperties(int indexInDeclaredProperties)
INTERNAL:
-
getIndexInDeclaredProperties
public int getIndexInDeclaredProperties()
INTERNAL:
-
setValueProperty
public void setValueProperty(boolean valueProperty)
INTERNAL:
-
isValueProperty
public boolean isValueProperty()
INTERNAL:
-
setAppInfoElements
public void setAppInfoElements(java.util.List appInfoElements)
INTERNAL:
-
getAppInfoElements
public java.util.List getAppInfoElements()
INTERNAL:
-
getAppInfoMap
public java.util.Map getAppInfoMap()
INTERNAL:
-
setNameCollision
public void setNameCollision(boolean nameCollision)
-
isNameCollision
public boolean isNameCollision()
-
isDefaultSet
public boolean isDefaultSet()
INTERNAL: Return whether the default value has been set by the schema either via a define by an XSD or a DataObject.- Returns:
- isDefaultSet
-
setUri
public void setUri(java.lang.String uri)
-
getUri
public java.lang.String getUri()
-
buildXMLFragmentMapping
public org.eclipse.persistence.oxm.mappings.XMLFragmentMapping buildXMLFragmentMapping(java.lang.String uri)
-
buildXMLFragmentCollectionMapping
public org.eclipse.persistence.oxm.mappings.XMLFragmentCollectionMapping buildXMLFragmentCollectionMapping(java.lang.String mappingUri)
-
isSubstitutable
public boolean isSubstitutable()
-
setSubstitutable
public void setSubstitutable(boolean substitutable)
-
getSubstitutableElements
public java.util.Collection<SDOProperty> getSubstitutableElements()
-
setSubstitutableElements
public void setSubstitutableElements(java.util.Collection<SDOProperty> elements)
-
setFinalized
public void setFinalized(boolean isFinalized)
-
isFinalized
public boolean isFinalized()
-
hashCode
public int hashCode()
Return a unique hashCode (as an int) for this instance.- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Indicate if a given SDOProperty instance is equal to this instance. Equality is determined based on name, uri, and type. In addition, checking will be done to ensure that both properties are to be serialized in the same manner, ie. both to XML element or both to XML attribute.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- Object to compare to this SDOProperty instance- Returns:
- true if obj is equal to this SDOProperty instance, false if not
-
-