org.enhydra.xml.xmlc.dom
Interface AccessorGenerator

All Known Implementing Classes:
GenericAccessorGenerator

public interface AccessorGenerator

Interface for class to generate access methods in a DOM-specific manner.


Method Summary
 void createAccessMethodInit(ElementInfo elementInfo, String elementVarName, JavaCode body)
          Create code to setup an access method for an element when building the DOM.
 JavaMethod createAccessorMethod(ElementInfo elementInfo, ElementInfo.AccessorInfo accessor, boolean createDelegation, JavaClass docClass)
          Create a getElementXXX() or getTagXXX() method for an element.
 void createNullElementAccess(ElementInfo elementInfo, JavaCode body)
          Create code cached information so that element access methods return null.
 void createResetElementAccess(ElementInfo elementInfo, 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 setTextXXX() method for an element.
 

Method Detail

createAccessMethodInit

public void createAccessMethodInit(ElementInfo elementInfo,
                                   String elementVarName,
                                   JavaCode body)
Create code to setup an access method for an element when building the DOM.
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.

createNullElementAccess

public void createNullElementAccess(ElementInfo elementInfo,
                                    JavaCode body)
Create code cached information so that element access methods return null.
Parameters:
elementInfo - Information about the element.
body - Append creation code to this code in the document builder that is being generated.

createResetElementAccess

public void createResetElementAccess(ElementInfo elementInfo,
                                     String nodeVarName,
                                     JavaCode body)
Create code to reset the element access information from a node.
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.

createAccessorMethod

public JavaMethod createAccessorMethod(ElementInfo elementInfo,
                                       ElementInfo.AccessorInfo accessor,
                                       boolean createDelegation,
                                       JavaClass docClass)
Create a getElementXXX() or getTagXXX() method for an element.
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.

createSetTextMethod

public JavaMethod createSetTextMethod(ElementInfo elementInfo,
                                      boolean createDelegation,
                                      JavaClass docClass)
Create the setTextXXX() method for an element.
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.


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.