com.format.xml
API has been deprecated. Instead, use the com.format.xml.bind
API.public abstract class ALcdXMLVisitorBasedElementAdapter extends Object implementsILcdXMLElementAdapter
ILcdXMLElementAdapter
, facilitating
the implementation of custom XML adapters.
Typically, when extending this class, the following methods need to be overwritten:
ILcdXMLElementAdapter
interface are implemented by this adapter using delegation to the visit...() methods. These methods
should normally not be overwritten.
This adapter is considered as the default (non-typed) element adapter class to extend from,
offering an easy and compact implementation, and excellent serial access performance.Constructor and Description |
---|
ALcdXMLVisitorBasedElementAdapter(ILcdXMLElementAdapterProvider aElementAdapterProvider,
ILcdXMLElementNameProvider aElementNameProvider)
Deprecated.
Constructs a new
ALcdXMLElementAdapter , initialized with the specified
ILcdXMLElementAdapterProvider and ILcdXMLElementNameProvider . |
ALcdXMLVisitorBasedElementAdapter(ILcdXMLElementAdapterProvider aElementAdapterProvider,
TLcdXMLName aElementName)
Deprecated.
Constructs a new
ALcdXMLElementAdapter , initialized with the specified
ILcdXMLElementAdapterProvider and a fixed element name. |
Modifier and Type | Method and Description |
---|---|
int |
getAttributeCount(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack)
Deprecated.
Inspects the object on top of the name/object stack: returns the number of attributes, contained
in the inspected object.
|
TLcdXMLName |
getAttributeName(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
int aIndex)
Deprecated.
Inspects the object on top of the name/object stack: returns the name of the attribute at
the given index.
|
Object |
getAttributeValue(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
int aIndex)
Deprecated.
Inspects the object on top of the name/object stack: returns the value of the attribute at
the given index.
|
Object |
getAttributeValue(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
TLcdXMLName aAttributeName)
Deprecated.
Inspects the object on top of the name/object stack: returns the value of the attribute with
the specified name, or
null if no such attribute exists. |
String |
getAttributeValueAsString(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
int aIndex)
Deprecated.
Inspects the object on top of the name/object stack: returns the value of the attribute at
the given index, as a String.
|
String |
getAttributeValueAsString(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
TLcdXMLName aAttributeName)
Deprecated.
Inspects the object on top of the name/object stack: returns the value of the attribute with
the specified name, as a String.
|
Object |
getContent(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
int aIndex)
Deprecated.
Inspects the object on top of the name/object stack: returns the content,
at the given index.
|
Object |
getContent(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
TLcdXMLName aXMLName,
int aIndex)
Deprecated.
The default implementation iterates over all contents, and counts the number of elements having
the provided XML name, to retrieve the content at position
aIndex . |
ILcdXMLElementAdapter |
getContentAdapter(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
int aIndex)
Deprecated.
Inspects the object on top of the name/object stack: returns a suitable
ILcdXMLElementAdapter for the content at the given index. |
ILcdXMLElementAdapter |
getContentAdapter(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
TLcdXMLName aXMLName,
int aIndex)
Deprecated.
Returns an XML adapter for the content at the specified index in the list of contents having
the specified XML name.
|
String |
getContentAsString(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
int aIndex)
Deprecated.
Inspects the object on top of the name/object stack: returns the content,
at the given index, as a String.
|
String |
getContentAsString(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
TLcdXMLName aXMLName,
int aIndex)
Deprecated.
Returns the
toString() value of the Object returned by getContent() . |
int |
getContentCount(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack)
Deprecated.
Inspects the object on top of the name/object stack: returns the number of contents, contained
in the inspected object.
|
int |
getContentCount(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
TLcdXMLName aXMLName)
Deprecated.
The default implementation iterates over all contents, and counts the number of elements having
the provided XML name.
|
TLcdXMLName |
getContentName(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
int aIndex)
Deprecated.
Inspects the object on top of the name/object stack: returns the name of the content
at the given index.
|
protected ILcdXMLElementAdapterProvider |
getElementAdapterProvider()
Deprecated.
Returns the
ILcdXMLElementAdapterProvider from which child adapters are retrieved. |
protected ILcdXMLElementNameProvider |
getElementNameProvider()
Deprecated.
Returns the
ILcdXMLElementNameProvider which is used to retrieve XML names. |
TLcdXMLName |
getName(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
TLcdXMLName aSubstitutionGroup,
Object aObject)
Deprecated.
Returns the name of the object specified by the given name/object stack, substitution group
and object.
|
boolean |
isPrimitiveContent(ILcdXMLNameStack aNameStack,
ILcdXMLObjectStack aObjectStack,
int aIndex)
Deprecated.
Inspects the object on top of the name/object stack: returns
true if the content
at the given index is primitive content (i.e., no XML element), false otherwise. |
void |
visitAttributes(ILcdXMLEditableNameStack aNameStack,
ILcdXMLEditableObjectStack aObjectStack,
ILcdXMLElementVisitor aElementVisitor,
ILcdXMLDocumentContext aDocumentContext)
Deprecated.
Visits the attributes of the element, specified by the given name and object stack .
|
protected void |
visitContent(ILcdXMLEditableNameStack aParentElementNameStack,
ILcdXMLEditableObjectStack aParentObjectStack,
TLcdXMLName aName,
Object aContent,
ILcdXMLElementVisitor aElementVisitor,
ILcdXMLDocumentContext aDocumentContext)
Deprecated.
Convenience method that can be called from the
visitContents() method, to process one child content. |
void |
visitContents(ILcdXMLEditableNameStack aNameStack,
ILcdXMLEditableObjectStack aObjectStack,
ILcdXMLElementVisitor aElementVisitor,
ILcdXMLDocumentContext aDocumentContext)
Deprecated.
Visits the contents of the element, specified by the given name and object stack .
|
void |
visitElement(ILcdXMLEditableNameStack aNameStack,
ILcdXMLEditableObjectStack aObjectStack,
TLcdXMLName aSubstitutionGroup,
Object aObject,
ILcdXMLElementVisitor aElementVisitor,
ILcdXMLDocumentContext aDocumentContext)
Deprecated.
Visits the given element.
|
public ALcdXMLVisitorBasedElementAdapter(ILcdXMLElementAdapterProvider aElementAdapterProvider, ILcdXMLElementNameProvider aElementNameProvider)
ALcdXMLElementAdapter
, initialized with the specified
ILcdXMLElementAdapterProvider
and ILcdXMLElementNameProvider
.aElementAdapterProvider
- the ILcdXMLElementAdapterProvider
to be used for
retrieving child adapters.aElementNameProvider
- the ILcdXMLElementNameProvider
to be used for
retrieving element names.public ALcdXMLVisitorBasedElementAdapter(ILcdXMLElementAdapterProvider aElementAdapterProvider, TLcdXMLName aElementName)
ALcdXMLElementAdapter
, initialized with the specified
ILcdXMLElementAdapterProvider
and a fixed element name.aElementAdapterProvider
- the ILcdXMLElementAdapterProvider
to be used for
retrieving child adapters.aElementName
- the name of the element handled by this adapter.public TLcdXMLName getName(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aSubstitutionGroup, Object aObject)
ILcdXMLElementAdapter
getName
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aSubstitutionGroup
- the substitution group the returned element should belong to, if
there is one (null
otherwise).aObject
- the element for which to return a name.public TLcdXMLName getAttributeName(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex)
ILcdXMLElementAdapter
getAttributeName
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aIndex
- the index of the attribute whose name is to be returned.public Object getAttributeValue(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex)
ILcdXMLElementAdapter
getAttributeValue
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aIndex
- the index of the attribute whose value is to be returned.public String getAttributeValueAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex)
ILcdXMLElementAdapter
getAttributeValueAsString
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aIndex
- the index of the content whose name is to be returned.public int getAttributeCount(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack)
ILcdXMLElementAdapter
getAttributeCount
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.public Object getAttributeValue(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aAttributeName)
ILcdXMLElementAdapter
null
if no such attribute exists.getAttributeValue
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aAttributeName
- the name of the attribute for which to return a value.public String getAttributeValueAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aAttributeName)
ILcdXMLElementAdapter
getAttributeValueAsString
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aAttributeName
- the name of the attribute for which to return a value.public TLcdXMLName getContentName(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex)
ILcdXMLElementAdapter
<element name="xxx" type="yyy"/>
), this
name can be returned immediately.<element ref="zzz">
),
the child adapter should be retrieved, and the call should be forwarded to the
getName()
method of the child adapter, with the given substitution group.getName()
method of the child adapter,
with the null
argument as substitution group.getContentName
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aIndex
- the index of the content whose name is to be returned.public Object getContent(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex)
ILcdXMLElementAdapter
getContent
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aIndex
- the index of the content whose name is to be returned.public String getContentAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex)
ILcdXMLElementAdapter
getContentAsString
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aIndex
- the index of the content whose name is to be returned.public ILcdXMLElementAdapter getContentAdapter(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex)
ILcdXMLElementAdapter
ILcdXMLElementAdapter
for the content at the given index.getContentAdapter
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aIndex
- the index of the content whose name is to be returned.public boolean isPrimitiveContent(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex)
ILcdXMLElementAdapter
true
if the content
at the given index is primitive content (i.e., no XML element), false
otherwise.isPrimitiveContent
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.aIndex
- the index of the content whose name is to be returned.true
if the content at the given index is primitive content,
false
otherwise.public int getContentCount(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack)
ILcdXMLElementAdapter
getContentCount
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be inspected.aObjectStack
- the XML object stack, identifying the XML element to be inspected.public int getContentCount(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName)
getContentCount
in interface ILcdXMLElementAdapter
aNameStack
- aObjectStack
- aXMLName
- public Object getContent(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex)
aIndex
.getContent
in interface ILcdXMLElementAdapter
aNameStack
- aObjectStack
- aXMLName
- aIndex
- public String getContentAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex)
toString()
value of the Object returned by getContent()
.getContentAsString
in interface ILcdXMLElementAdapter
aNameStack
- aObjectStack
- aIndex
- aXMLName
- the name of the content to be returned.getContent(aNameStack, aObjectStack, aXMLName, aIndex).toString()
public ILcdXMLElementAdapter getContentAdapter(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex)
ILcdXMLElementAdapterProvider
that was provided at construction time.getContentAdapter
in interface ILcdXMLElementAdapter
aNameStack
- aObjectStack
- aIndex
- aXMLName
- the name of the content for which to return an adapter.public void visitElement(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, TLcdXMLName aSubstitutionGroup, Object aObject, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) throws TLcdXMLInterruptedException
ILcdXMLElementAdapter
ILcdXMLElementVisitor
interface documentation contains a detailed description
of how an XML element needs to be visited.visitElement
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be visited.aObjectStack
- the XML object stack, identifying the XML element to be visited.aSubstitutionGroup
- the element name or substitution group of the element to be visitedaObject
- the lement to be visitedaElementVisitor
- the element visitor which is called by this visitable.aDocumentContext
- the XML document contextTLcdXMLInterruptedException
- if the visit action has been interrupted.ILcdXMLElementVisitor
public void visitAttributes(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) throws TLcdXMLInterruptedException
ILcdXMLElementAdapter
visitAttributes
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be visited.aObjectStack
- the XML object stack, identifying the XML element to be visited.aElementVisitor
- the element visitor which is called by this visitable.aDocumentContext
- the XML document contextTLcdXMLInterruptedException
- if the visit action has been interrupted.ILcdXMLElementVisitor
public void visitContents(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) throws TLcdXMLInterruptedException
ILcdXMLElementAdapter
visitContents
in interface ILcdXMLElementAdapter
aNameStack
- the XML name stack, identifying the XML element to be visited.aObjectStack
- the XML object stack, identifying the XML element to be visited.aElementVisitor
- the element visitor which is called by this visitable.aDocumentContext
- the XML document contextTLcdXMLInterruptedException
- if the visit action has been interrupted.ILcdXMLElementVisitor
protected void visitContent(ILcdXMLEditableNameStack aParentElementNameStack, ILcdXMLEditableObjectStack aParentObjectStack, TLcdXMLName aName, Object aContent, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) throws TLcdXMLInterruptedException
visitContents()
method, to process one child content.
When called, an adapter will be retrieved from the element adapter provider, and, if it is not
null
, the child adapter's visitElement()
method will be called with all
parameters passed to this method.aParentElementNameStack
- aParentObjectStack
- aName
- aContent
- aElementVisitor
- aDocumentContext
- TLcdXMLInterruptedException
protected ILcdXMLElementAdapterProvider getElementAdapterProvider()
ILcdXMLElementAdapterProvider
from which child adapters are retrieved.ILcdXMLElementAdapterProvider
from which child adapters are retrieved.protected ILcdXMLElementNameProvider getElementNameProvider()
ILcdXMLElementNameProvider
which is used to retrieve XML names.ILcdXMLElementNameProvider
which is used to retrieve XML names.