All Packages Class Hierarchy This Package Previous Next Index
Class org.xmlmiddleware.xmldbms.maps.ClassMap
java.lang.Object
|
+----org.xmlmiddleware.xmldbms.maps.MapBase
|
+----org.xmlmiddleware.xmldbms.maps.ClassMapBase
|
+----org.xmlmiddleware.xmldbms.maps.ClassMap
- public class ClassMap
- extends ClassMapBase
Maps an element type as a class; not for
general use.
ClassMap contains information about an element type that is viewed as
a class and mapped to a class table. It contains the name of the element type
and the table, as well as information about a base class map (if any) and
maps for attributes, PCDATA, and child element types.
ClassMap inherits from ClassMapBase, which provides an accessor for the
element type name and accessors and mutators for attribute, PCDATA, and
child element type maps. It adds accessors and mutators for class table, base
table, and used class map.
If this ClassMap uses a different ClassMap (which effectively "casts" the
element type mapped by this ClassMap to the element type mapped by the other
ClassMap), then all mutator methods except useClassMap() return an
IllegalStateException.
ClassMaps are stored in the XMLDBMSMap class. They are pointed to by ClassMaps
and RelatedClassMaps.
- Version:
- 2.0
- Author:
- Ronald Bourret, 1998-9, 2001
-
addAttributeMap(PropertyMap)
- Add a PropertyMap for an attribute.
-
addChildMap(InlineClassMap)
- Add an InlineClassMap for a child element type.
-
addChildMap(PropertyMap)
- Add a PropertyMap for a child element type.
-
addChildMap(RelatedClassMap)
- Add a RelatedClassMap for a child element type.
-
addPCDATAMap(PropertyMap)
- Add a PropertyMap for PCDATA.
-
create(String, String)
- Create a new ClassMap.
-
create(XMLName)
- Create a new ClassMap.
-
createAttributeMap(String, String)
- Create a PropertyMap for an attribute and add it to this map.
-
createAttributeMap(XMLName)
- Create a PropertyMap for an attribute and add it to this map.
-
createChildPropertyMap(String, String)
- Create a PropertyMap for a child element type and add it to this map.
-
createChildPropertyMap(XMLName)
- Create a PropertyMap for a child element type and add it to this map.
-
createInlineClassMap(String, String)
- Create an InlineClassMap for a child element type and add it to this map.
-
createInlineClassMap(XMLName)
- Create an InlineClassMap for a child element type and add it to this map.
-
createPCDATAMap()
- Create a new PropertyMap for PCDATA.
-
createRelatedClassMap(String, String)
- Create a RelatedClassMap for a child element type and add it to this map.
-
createRelatedClassMap(XMLName)
- Create a RelatedClassMap for a child element type and add it to this map.
-
getBaseClassMap()
- Get the name of the base ClassMap, if one is being used.
-
getBaseLinkInfo()
- Get the LinkInfo used to link the class table to the base class table.
-
getTable()
- Get the table to which the class is mapped.
-
getUsedClassMap()
- Get the ClassMap used by this ClassMap.
-
removeAllAttributeMaps()
- Remove the PropertyMaps for all attributes.
-
removeAllChildMaps()
- Remove the maps for all child element types.
-
removeAttributeMap(String)
- Remove the PropertyMap for an attribute.
-
removeAttributeMap(String, String)
- Remove the PropertyMap for an attribute.
-
removeChildMap(String)
- Remove the map for a child element type.
-
removeChildMap(String, String)
- Remove the map for a child element type.
-
removePCDATAMap()
- Remove the PropertyMap for PCDATA.
-
setBaseClassMap(ClassMap)
- Set the base ClassMap.
-
setBaseLinkInfo(LinkInfo)
- Set the LinkInfo used to link the class table to the base class table.
-
setTable(Table)
- Set the table to which the class is mapped.
-
useClassMap(ClassMap)
- Use the ClassMap for a different element type.
create
public static ClassMap create(String uri,
String localName)
- Create a new ClassMap.
- Parameters:
- uri - Namespace URI of the element type being mapped. May be null.
- localName - Local name of the element type being mapped.
- Returns:
- The ClassMap.
create
public static ClassMap create(XMLName elementTypeName)
- Create a new ClassMap.
- Parameters:
- elementTypeName - XMLName of the element type being mapped.
- Returns:
- The ClassMap.
getTable
public final Table getTable()
- Get the table to which the class is mapped.
- Returns:
- The table.
setTable
public void setTable(Table table)
- Set the table to which the class is mapped.
- Parameters:
- table - The table. May be null.
getBaseClassMap
public final ClassMap getBaseClassMap()
- Get the name of the base ClassMap, if one is being used.
- Returns:
- The base ClassMap. May be null.
setBaseClassMap
public void setBaseClassMap(ClassMap baseClassMap)
- Set the base ClassMap.
- Parameters:
- baseClassMap - The base ClassMap. If there is no base ClassMap,
set this to null, in which case the information used to link the
class table to the base table is set to null.
getBaseLinkInfo
public final LinkInfo getBaseLinkInfo()
- Get the LinkInfo used to link the class table to the base class table.
- Returns:
- The LinkInfo. The "parent" table is the base class table. Null if
the base class table is not used.
setBaseLinkInfo
public void setBaseLinkInfo(LinkInfo baseLinkInfo)
- Set the LinkInfo used to link the class table to the base class table.
This method may not be called if the base ClassMap is null.
Setting the baseLinkInfo argument to null when the base ClassMap is non-null
is useful if you want the map objects to preserve inheritance information
but want to store the data for the class in a single table, rather than in a
base table and a class table. Inheritance information can then be used elsewhere,
such as when an XML Schema is generated from an XMLDBMSMap.
- Parameters:
- baseLinkInfo - The LinkInfo. The "parent" table is the base class table.
Null if the base class table is not used.
getUsedClassMap
public final ClassMap getUsedClassMap()
- Get the ClassMap used by this ClassMap.
The ClassMap returned by this method might use another ClassMap, and so
on. It is the responsibility of the calling application to navigate the
chain of ClassMaps.
If the returned value is not null, then no other methods may be called
to set properties of this ClassMap (except useClassMap()) and the values
returned by methods that get properties of this ClassMap are undefined.
- Returns:
- The ClassMap used by this ClassMap. May be null.
useClassMap
public void useClassMap(ClassMap useClassMap)
- Use the ClassMap for a different element type.
Using the ClassMap for a different element type effectively "casts" the
element type mapped by this ClassMap to the other element type. For more
information, see the description of the <UseClassMap> element type in the
XML-DBMS mapping language.
Calling this method with a non-null useClassMap argument sets all
other properties (class table, attribute maps, etc.) to their initial
state (null, empty, false, etc.)
- Parameters:
- useClassMap - The ClassMap to use. Set this to null to use the
current ClassMap.
createAttributeMap
public PropertyMap createAttributeMap(String uri,
String localName)
- Create a PropertyMap for an attribute and add it to this map.
If the attribute has already been mapped, returns the existing PropertyMap.
- Parameters:
- uri - Namespace URI of the attribute. May be null.
- localName - Local name of the attribute.
- Returns:
- The PropertyMap for the attribute.
- Overrides:
- createAttributeMap in class ClassMapBase
createAttributeMap
public PropertyMap createAttributeMap(XMLName xmlName)
- Create a PropertyMap for an attribute and add it to this map.
If the attribute has already been mapped, returns the existing PropertyMap.
- Parameters:
- xmlName - XMLName of the attribute.
- Returns:
- The PropertyMap for the attribute.
- Overrides:
- createAttributeMap in class ClassMapBase
addAttributeMap
public void addAttributeMap(PropertyMap propMap) throws XMLMiddlewareException
- Add a PropertyMap for an attribute.
- Parameters:
- propMap - PropertyMap for the attribute. Must not be null.
- Throws: XMLMiddlewareException
- Thrown if the attribute has already been mapped.
- Overrides:
- addAttributeMap in class ClassMapBase
removeAttributeMap
public void removeAttributeMap(String uri,
String localName) throws XMLMiddlewareException
- Remove the PropertyMap for an attribute.
- Parameters:
- uri - Namespace URI of the attribute. May be null.
- localName - Local name of the attribute.
- Throws: XMLMiddlewareException
- Thrown if the attribute has not been mapped.
- Overrides:
- removeAttributeMap in class ClassMapBase
removeAttributeMap
public void removeAttributeMap(String universalName) throws XMLMiddlewareException
- Remove the PropertyMap for an attribute.
- Parameters:
- universalName - Universal name of the attribute.
- Throws: XMLMiddlewareException
- Thrown if the attribute has not been mapped.
- Overrides:
- removeAttributeMap in class ClassMapBase
removeAllAttributeMaps
public void removeAllAttributeMaps()
- Remove the PropertyMaps for all attributes.
- Overrides:
- removeAllAttributeMaps in class ClassMapBase
createPCDATAMap
public PropertyMap createPCDATAMap()
- Create a new PropertyMap for PCDATA.
If PCDATA has already been mapped, returns the existing PropertyMap.
- Returns:
- A PropertyMap for PCDATA.
- Overrides:
- createPCDATAMap in class ClassMapBase
addPCDATAMap
public void addPCDATAMap(PropertyMap propMap) throws XMLMiddlewareException
- Add a PropertyMap for PCDATA.
- Parameters:
- propMap - PropertyMap for PCDATA. Must not be null.
- Throws: XMLMiddlewareException
- Thrown if PCDATA has already been mapped.
- Overrides:
- addPCDATAMap in class ClassMapBase
removePCDATAMap
public void removePCDATAMap() throws XMLMiddlewareException
- Remove the PropertyMap for PCDATA.
- Throws: XMLMiddlewareException
- Thrown if PCDATA has not been mapped.
- Overrides:
- removePCDATAMap in class ClassMapBase
createChildPropertyMap
public PropertyMap createChildPropertyMap(String uri,
String localName) throws XMLMiddlewareException
- Create a PropertyMap for a child element type and add it to this map.
If the child element type has already been mapped as a property, returns the
existing PropertyMap.
- Parameters:
- uri - Namespace URI of the child element type. May be null.
- localName - Local name of the child element type.
- Returns:
- The PropertyMap for the child element type.
- Throws: XMLMiddlewareException
- Thrown if the child element type is already
mapped as a related class or inlined class.
- Overrides:
- createChildPropertyMap in class ClassMapBase
createChildPropertyMap
public PropertyMap createChildPropertyMap(XMLName elementTypeName) throws XMLMiddlewareException
- Create a PropertyMap for a child element type and add it to this map.
If the child element type has already been mapped as a property, returns the
existing PropertyMap.
- Parameters:
- elementTypeName - XMLName of the child element type.
- Returns:
- The PropertyMap for the child element type.
- Throws: XMLMiddlewareException
- Thrown if the child element type is already
mapped as a related class or inlined class.
- Overrides:
- createChildPropertyMap in class ClassMapBase
createRelatedClassMap
public RelatedClassMap createRelatedClassMap(String uri,
String localName) throws XMLMiddlewareException
- Create a RelatedClassMap for a child element type and add it to this map.
If the child element type has already been mapped as a related class, returns the
existing RelatedClassMap.
- Parameters:
- uri - Namespace URI of the child element type. May be null.
- localName - Local name of the child element type.
- Returns:
- The RelatedClassMap for the child element type.
- Throws: XMLMiddlewareException
- Thrown if the child element type is already
mapped as a property or inlined class.
- Overrides:
- createRelatedClassMap in class ClassMapBase
createRelatedClassMap
public RelatedClassMap createRelatedClassMap(XMLName elementTypeName) throws XMLMiddlewareException
- Create a RelatedClassMap for a child element type and add it to this map.
If the child element type has already been mapped as a related class, returns the
existing RelatedClassMap.
- Parameters:
- elementTypeName - XMLName of the child element type.
- Returns:
- The RelatedClassMap for the child element type.
- Throws: XMLMiddlewareException
- Thrown if the child element type is already
mapped as a property or inlined class.
- Overrides:
- createRelatedClassMap in class ClassMapBase
createInlineClassMap
public InlineClassMap createInlineClassMap(String uri,
String localName) throws XMLMiddlewareException
- Create an InlineClassMap for a child element type and add it to this map.
If the child element type has already been mapped as an inlined class, returns the
existing InlineClassMap.
- Parameters:
- uri - Namespace URI of the child element type. May be null.
- localName - Local name of the child element type.
- Returns:
- The InlineClassMap for the child element type.
- Throws: XMLMiddlewareException
- Thrown if the child element type is already
mapped as a property or related class.
- Overrides:
- createInlineClassMap in class ClassMapBase
createInlineClassMap
public InlineClassMap createInlineClassMap(XMLName elementTypeName) throws XMLMiddlewareException
- Create an InlineClassMap for a child element type and add it to this map.
If the child element type has already been mapped as an inlined class, returns the
existing InlineClassMap.
- Parameters:
- elementTypeName - XMLName of the child element type.
- Returns:
- The InlineClassMap for the child element type.
- Throws: XMLMiddlewareException
- Thrown if the child element type is already
mapped as a property or related class.
- Overrides:
- createInlineClassMap in class ClassMapBase
addChildMap
public void addChildMap(PropertyMap propMap) throws XMLMiddlewareException
- Add a PropertyMap for a child element type.
- Parameters:
- propMap - PropertyMap for the child element type. Must not be null.
- Throws: XMLMiddlewareException
- Thrown if the child element type has already been mapped.
- Overrides:
- addChildMap in class ClassMapBase
addChildMap
public void addChildMap(RelatedClassMap relatedClassMap) throws XMLMiddlewareException
- Add a RelatedClassMap for a child element type.
The RelatedClassMap is added under the name returned by
RelatedClassMap.getElementTypeName(). This may be different from the name returned
by RelatedClassMap.getClassMap().getElementTypeName(). That is, the referenced
element type might be mapped using the ClassMap for another element type. This
effectively "casts" the reference to the second element type. For more
information, see the description of the <UseClassMap> element type in the
XML-DBMS mapping language.
- Parameters:
- relatedClassMap - RelatedClassMap for the child element type. Must not be null.
- Throws: XMLMiddlewareException
- Thrown if the child element type has already been mapped.
- Overrides:
- addChildMap in class ClassMapBase
addChildMap
public void addChildMap(InlineClassMap inlineClassMap) throws XMLMiddlewareException
- Add an InlineClassMap for a child element type.
- Parameters:
- inlineClassMap - InlineClassMap for the child element type. Must not be null.
- Throws: XMLMiddlewareException
- Throw if the child element type is already mapped.
- Overrides:
- addChildMap in class ClassMapBase
removeChildMap
public void removeChildMap(String uri,
String localName) throws XMLMiddlewareException
- Remove the map for a child element type.
- Parameters:
- uri - Namespace URI of the child element type. May be null.
- localName - Local name of the child element type.
- Throws: XMLMiddlewareException
- Thrown if the child element type has not been mapped.
- Overrides:
- removeChildMap in class ClassMapBase
removeChildMap
public void removeChildMap(String universalName) throws XMLMiddlewareException
- Remove the map for a child element type.
- Parameters:
- universalName - Universal name of the child element type.
- Throws: XMLMiddlewareException
- Thrown if the child element type has not been mapped.
- Overrides:
- removeChildMap in class ClassMapBase
removeAllChildMaps
public void removeAllChildMaps()
- Remove the maps for all child element types.
- Overrides:
- removeAllChildMaps in class ClassMapBase
All Packages Class Hierarchy This Package Previous Next Index