Enhydra 5.1 API

org.enhydra.xml.xmlc.dom.lazydom
Class LazyDOMAccessorGenerator

java.lang.Object
  |
  +--org.enhydra.xml.xmlc.dom.generic.GenericAccessorGenerator
        |
        +--org.enhydra.xml.xmlc.dom.lazydom.LazyDOMAccessorGenerator
All Implemented Interfaces:
AccessorGenerator

public class LazyDOMAccessorGenerator
extends GenericAccessorGenerator
implements AccessorGenerator

Generate access methods for the Lazy DOM.


Constructor Summary
protected LazyDOMAccessorGenerator(Document document)
          Constructor.
 
Method Summary
 void createAccessMethodInit(ElementInfo elementInfo, java.lang.String elementVarName, JavaCode body)
          This method does nothing for the Lazy DOM.
 JavaMethod createAccessorMethod(ElementInfo elementInfo, ElementInfo.AccessorInfo accessor, boolean createDelegation, JavaClass docClass)
          Create an element accessor method (getElementXXX() or getTextXXX()).
 void createNullElementAccess(ElementInfo elementInfo, JavaCode body)
          Create code cached information so that element access methods return null.
 void createResetElementAccess(ElementInfo elementInfo, java.lang.String nodeVarName, JavaCode body)
          Create code to reset the element access information from a node.
 JavaMethod createSetTextMethod(ElementInfo elementInfo, boolean createDelegation, JavaClass docClass)
          Create the setText method for an element.
 
Methods inherited from class org.enhydra.xml.xmlc.dom.generic.GenericAccessorGenerator
getElementField, setupGetElementMethod, setupSetTextMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyDOMAccessorGenerator

protected LazyDOMAccessorGenerator(Document document)
Constructor.

Method Detail

createAccessMethodInit

public void createAccessMethodInit(ElementInfo elementInfo,
                                   java.lang.String elementVarName,
                                   JavaCode body)
This method does nothing for the Lazy DOM.

Specified by:
createAccessMethodInit in interface AccessorGenerator
Overrides:
createAccessMethodInit in class GenericAccessorGenerator
Parameters:
elementInfo - Information about the element.
elementVarName - The name of a variable that will contain the element during document construction at the point that the element is created. The type of the variable will be Element.
body - Append creation code to this code in the document builder that is being generated.
See Also:
AccessorGenerator.createAccessMethodInit(org.enhydra.xml.xmlc.compiler.ElementInfo, java.lang.String, org.enhydra.xml.xmlc.codegen.JavaCode)

createNullElementAccess

public void createNullElementAccess(ElementInfo elementInfo,
                                    JavaCode body)
Create code cached information so that element access methods return null.

Specified by:
createNullElementAccess in interface AccessorGenerator
Overrides:
createNullElementAccess in class GenericAccessorGenerator
Parameters:
elementInfo - Information about the element.
body - Append creation code to this code in the document builder that is being generated.
See Also:
AccessorGenerator.createNullElementAccess(org.enhydra.xml.xmlc.compiler.ElementInfo, org.enhydra.xml.xmlc.codegen.JavaCode)

createResetElementAccess

public void createResetElementAccess(ElementInfo elementInfo,
                                     java.lang.String nodeVarName,
                                     JavaCode body)
Create code to reset the element access information from a node.

Specified by:
createResetElementAccess in interface AccessorGenerator
Overrides:
createResetElementAccess in class GenericAccessorGenerator
Parameters:
elementInfo - Information about the element.
nodeVarName - The name of the variable that will contain element. It will be of type Node, so it must be cast.
body - Append creation code to this code in the document builder that is being generated.
See Also:
AccessorGenerator.createResetElementAccess(org.enhydra.xml.xmlc.compiler.ElementInfo, java.lang.String, org.enhydra.xml.xmlc.codegen.JavaCode)

createAccessorMethod

public JavaMethod createAccessorMethod(ElementInfo elementInfo,
                                       ElementInfo.AccessorInfo accessor,
                                       boolean createDelegation,
                                       JavaClass docClass)
Create an element accessor method (getElementXXX() or getTextXXX()).

Specified by:
createAccessorMethod in interface AccessorGenerator
Overrides:
createAccessorMethod in class GenericAccessorGenerator
Parameters:
elementInfo - Information about the element.
accessor - Infomation about the accessor to create.
createDelegation - Should delegation support be created?
docClass - The document class that is being generated. The method is added to this class.
Returns:
The method that was created. Used only in producing a listing.
See Also:
AccessorGenerator#createGetElementMethod

createSetTextMethod

public JavaMethod createSetTextMethod(ElementInfo elementInfo,
                                      boolean createDelegation,
                                      JavaClass docClass)
Create the setText method for an element.

Specified by:
createSetTextMethod in interface AccessorGenerator
Overrides:
createSetTextMethod in class GenericAccessorGenerator
Parameters:
elementInfo - Information about the element.
createDelegation - Should delegation support be created?
docClass - The document class that is being generated. The method is added to this class.
Returns:
The method that was created. Used only in producing a listing.
See Also:
AccessorGenerator#createGetElementMethod

Enhydra 5.1 API