KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > dom > AccessorGenerator


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  * $Id: AccessorGenerator.java,v 1.2 2005/01/26 08:29:24 jkjome Exp $
22  */

23
24 package org.enhydra.xml.xmlc.dom;
25
26 import org.enhydra.xml.xmlc.codegen.JavaClass;
27 import org.enhydra.xml.xmlc.codegen.JavaCode;
28 import org.enhydra.xml.xmlc.codegen.JavaMethod;
29 import org.enhydra.xml.xmlc.compiler.ElementInfo;
30
31 /**
32  * Interface for class to generate access methods in a DOM-specific manner.
33  */

34 public interface AccessorGenerator {
35     /**
36      * Create code to setup an access method for an element when building the
37      * DOM.
38      *
39      * @param elementInfo Information about the element.
40      * @param elementVarName The name of a variable that will contain
41      * the element during document construction at the point that
42      * the element is created. The type of the variable will be Element.
43      * @param body Append creation code to this code in the document builder
44      * that is being generated.
45      */

46     public void createAccessMethodInit(ElementInfo elementInfo,
47                                        String JavaDoc elementVarName,
48                                        JavaCode body);
49
50     /**
51      * Create code cached information so that element access methods
52      * return null.
53      *
54      * @param elementInfo Information about the element.
55      * @param body Append creation code to this code in the document builder
56      * that is being generated.
57      */

58     public void createNullElementAccess(ElementInfo elementInfo,
59                                         JavaCode body);
60
61     /**
62      * Create code to reset the element access information from a node.
63      *
64      * @param elementInfo Information about the element.
65      * @param nodeVarName The name of the variable that will contain
66      * element. It will be of type Node, so it must be cast.
67      * @param body Append creation code to this code in the document builder
68      * that is being generated.
69      */

70     public void createResetElementAccess(ElementInfo elementInfo,
71                                          String JavaDoc nodeVarName,
72                                          JavaCode body);
73
74     /**
75      * Create a getElementXXX() or getTagXXX() method for an element.
76      *
77      * @param elementInfo Information about the element.
78      * @param accessor Infomation about the accessor to create.
79      * @param createDelegation Should delegation support be created?
80      * @param docClass The document class that is being generated.
81      * The method is added to this class.
82      * @return The method that was created. Used only in producing a listing.
83      */

84     public JavaMethod createAccessorMethod(ElementInfo elementInfo,
85                                            ElementInfo.AccessorInfo accessor,
86                                            boolean createDelegation,
87                                            JavaClass docClass);
88     
89     /**
90      * Create the setTextXXX() method for an element.
91      *
92      * @param elementInfo Information about the element.
93      * @param createDelegation Should delegation support be created?
94      * @param docClass The document class that is being generated.
95      * The method is added to this class.
96      * @return The method that was created. Used only in producing a listing.
97      */

98     public JavaMethod createSetTextMethod(ElementInfo elementInfo,
99                                           boolean createDelegation,
100                                           JavaClass docClass);
101 }
102
Popular Tags