Interface ILcdXMLElementAdapter

All Known Implementing Classes:
ALcdXMLIndexBasedElementAdapter, ALcdXMLTypedIndexBasedElementAdapter, ALcdXMLTypedVisitorBasedElementAdapter, ALcdXMLVisitorBasedElementAdapter, TLcdXMLDefaultElementAdapter

public interface ILcdXMLElementAdapter
Deprecated.
Use of the com.format.xml API has been deprecated. Instead, use the com.format.xml.bind API.
An adapter interface, for providing an XML view on an object. The ILcdXMLElementAdapter interface enables the user to inspect an object as if it was an implementation of ILcdXMLElement, even if it isn't. It can be used to convert an existing domain model into another, XML-based domain model. In general, a element adapter should be written for each (Java domain object, XML type) pair.

There are two parameters, common to each method in this interface:

  • an ILcdXMLNameStack, the XML element name stack that represents the location in the XML structure of the element to be inspected.
  • an ILcdXMLObjectStack, the object stack that contains all objects corresponding to the element name at same location in the element name stack.
By doing so, the element adapter doesn't need an internal state (all necessary information can be retrieved from the name and object stack), which implies only one instance need to be created for each adapter.

This interface is still subject to changes and should therefore not be implemented directly by users. Extend one of the ALcdXMLVisitorBasedElementAdapter or ALcdXMLTypedVistorBasesElementAdapter classes instead.

  • Method Details

    • getName

      TLcdXMLName getName(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aSubstitutionGroup, Object aElement)
      Deprecated.
      Returns the name of the object specified by the given name/object stack, substitution group and object.
      Parameters:
      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).
      aElement - the element for which to return a name.
      Returns:
      the element name that best matches the specified element.
    • getAttributeName

      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.
      Parameters:
      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.
      Returns:
      the name of the attribute with the given index.
    • getAttributeValue

      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.
      Parameters:
      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.
      Returns:
      the value of the attribute with the given index.
    • getAttributeValueAsString

      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.
      Parameters:
      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.
      Returns:
      the value of the attribute with the given index, as a String.
    • getAttributeCount

      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.
      Parameters:
      aNameStack - the XML name stack, identifying the XML element to be inspected.
      aObjectStack - the XML object stack, identifying the XML element to be inspected.
      Returns:
      the number of attributes for the object on top of the name/object stack.
    • getAttributeValue

      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.
      Parameters:
      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.
      Returns:
      the value of the attribute with the specified name.
    • getAttributeValueAsString

      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.
      Parameters:
      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.
      Returns:
      the value of the attribute with the given index, as a String.
    • getContentName

      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.

      In general, this method should be implemented as follows:

      • if the type of the current object enforces the child content at the given index to have a fixed name (e.g. <element name="xxx" type="yyy"/>), this name can be returned immediately.
      • if the type of the current object enforces the child content at the given index to belong to a certain substitution group (e.g. <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.
      • if nothing is known about the child content, the child adapter should be retrieved, and the call should be forwared to the getName() method of the child adapter, with the null argument as substitution group.
      Parameters:
      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.
      Returns:
      the name of the content with the given index.
    • getContent

      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.
      Parameters:
      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.
      Returns:
      the content with the given index.
    • getContentAsString

      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.
      Parameters:
      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.
      Returns:
      the content with the given index, as a String.
    • getContentCount

      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.
      Parameters:
      aNameStack - the XML name stack, identifying the XML element to be inspected.
      aObjectStack - the XML object stack, identifying the XML element to be inspected.
      Returns:
      the number of contents for the object on top of the name/object stack.
    • getContentAdapter

      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.
      Parameters:
      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.
      Returns:
      a suitable adapter for the content at the given index.
    • isPrimitiveContent

      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.
      Parameters:
      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.
      Returns:
      true if the content at the given index is primitive content, false otherwise.
    • getContent

      Object getContent(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex)
      Deprecated.
      Inspects the object on top of the name/object stack: returns the content at the specified index in the list of contents having the specified XML name.
      Parameters:
      aNameStack - the XML name stack, identifying the XML element to be inspected.
      aObjectStack - the XML object stack, identifying the XML element to be inspected.
      aXMLName - the name of the content to be returned.
      aIndex - the index of the content whose name is to be returned.
      Returns:
      the content with the given index.
    • getContentAsString

      String getContentAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex)
      Deprecated.
      Inspects the object on top of the name/object stack: returns the content at the specified index in the list of contents having the specified XML name, as a String.
      Parameters:
      aNameStack - the XML name stack, identifying the XML element to be inspected.
      aObjectStack - the XML object stack, identifying the XML element to be inspected.
      aXMLName - the name of the content to be returned.
      aIndex - the index of the content whose name is to be returned.
      Returns:
      the content with the given index, as a String.
    • getContentCount

      int getContentCount(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName)
      Deprecated.
      Inspects the object on top of the name/object stack: returns the number of contents, contained in the inspected object and having the specified XML name.
      Parameters:
      aNameStack - the XML name stack, identifying the XML element to be inspected.
      aObjectStack - the XML object stack, identifying the XML element to be inspected.
      aXMLName - the name of the contents.
      Returns:
      the number of contents for the object on top of the name/object stack.
    • getContentAdapter

      ILcdXMLElementAdapter getContentAdapter(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex)
      Deprecated.
      Inspects the object on top of the name/object stack: returns a suitable ILcdXMLElementAdapter for the content at the specified index in the list of contents having the specified XML name.
      Parameters:
      aNameStack - the XML name stack, identifying the XML element to be inspected.
      aObjectStack - the XML object stack, identifying the XML element to be inspected.
      aXMLName - the name of the content for which to return an adapter.
      aIndex - the index of the content whose name is to be returned.
      Returns:
      a suitable adapter for the content at the given index.
    • visitElement

      void visitElement(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, TLcdXMLName aName, Object aObject, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) throws TLcdXMLInterruptedException
      Deprecated.
      Visits the given element.

      The element to be visited is specified by a name and object stack, containing the XML stack up to the parent name/object, and a (name,object) pair.

      The ILcdXMLElementVisitor interface documentation contains a detailed description of how an XML element needs to be visited.

      Parameters:
      aNameStack - the XML name stack, identifying the XML element to be visited.
      aObjectStack - the XML object stack, identifying the XML element to be visited.
      aName - the element name or substitution group of the element to be visited
      aObject - the lement to be visited
      aElementVisitor - the element visitor which is called by this visitable.
      aDocumentContext - the XML document context
      Throws:
      TLcdXMLInterruptedException - if the visit action has been interrupted.
      See Also:
    • visitAttributes

      void visitAttributes(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) throws TLcdXMLInterruptedException
      Deprecated.
      Visits the attributes of the element, specified by the given name and object stack .

      Parameters:
      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 context
      Throws:
      TLcdXMLInterruptedException - if the visit action has been interrupted.
      See Also:
    • visitContents

      void visitContents(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) throws TLcdXMLInterruptedException
      Deprecated.
      Visits the contents of the element, specified by the given name and object stack .

      Parameters:
      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 context
      Throws:
      TLcdXMLInterruptedException - if the visit action has been interrupted.
      See Also: