com.format.xml.schema
API has been deprecated. Instead, use the com.format.xml.bind.schema
API.public class TLcdXMLTypedElementNameProvider extends Object implementsILcdXMLElementNameProvider
ILcdXMLElementNameProvider
.
Element names need only be registered for types; the provider will automatically
perform mappings from element stacks to types, as well as mappings from types to their
supertypes, based on the XML schema information provided by a ILcdXMLSchemaProvider
.Constructor and Description |
---|
TLcdXMLTypedElementNameProvider(ILcdXMLSchemaProvider aSchemaProvider)
Deprecated.
Creates a new, empty element name provider.
|
Modifier and Type | Method and Description |
---|---|
TLcdXMLName |
getElementNameForObject(ILcdXMLNameStack aParentElementNameStack,
ILcdXMLObjectStack aParentObjectStack,
TLcdXMLName aSubstitutionGroup,
Object aObject,
TLcdXMLName aTypeName)
Deprecated.
Returns the
TLcdXMLName that best matches the object, specified by the given
name/object stack, substitution group and object. |
void |
registerElementName(Class aJavaClass,
TLcdXMLName aElementName)
Deprecated.
Registers the given element name for the given Java type.
|
public TLcdXMLTypedElementNameProvider(ILcdXMLSchemaProvider aSchemaProvider)
aSchemaProvider
- the schema provider to be used by this provider. The schema provider will
be used to look up the type and possible supertypes of an element.public void registerElementName(Class aJavaClass, TLcdXMLName aElementName)
aJavaClass
- the Java class for which the given element name is to be registered.aElementName
- the element name to be registered.NullPointerException
- if one of the arguments is null
.public TLcdXMLName getElementNameForObject(ILcdXMLNameStack aParentElementNameStack, ILcdXMLObjectStack aParentObjectStack, TLcdXMLName aSubstitutionGroup, Object aObject, TLcdXMLName aTypeName)
ILcdXMLElementNameProvider
TLcdXMLName
that best matches the object, specified by the given
name/object stack, substitution group and object.
Note that in some cases, more than one name can be returned. E.g., the object for which to
return a name can implement multiple interfaces, each having a corresponding XML element name.
It is up to the implementation to decide which name is most suited for the current situation,
taking into account the name and object stack, the available element names and the XML type
and substitution group that are provided.
getElementNameForObject
in interface ILcdXMLElementNameProvider
aParentElementNameStack
- the XML name stack, containing all XML names from the root
element up to the parent element nameaParentObjectStack
- the XML object stack, containing all XML objects from the root
element up to the parent elementaSubstitutionGroup
- the substitution group the returned element should belong to, if
there is one (null
otherwise).aObject
- the element for which to return a name.aTypeName
- the name of the global type from which the type of the returned element name should
inherit, or null
if the element has an anonymous type.