KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > schema2beansdev > DocDefHandler


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.schema2beansdev;
21
22 import java.util.*;
23 import java.io.*;
24
25 import org.netbeans.modules.schema2beans.*;
26
27 /**
28  * The DTD parser handler
29  */

30 public interface DocDefHandler {
31     /**
32      * Called once, when the DTD is started to be parsed.
33      *
34      * @param root root elemement name of the document (as the DOCTYPE
35      * specifies in the XML document)
36      */

37     public void startDocument(String JavaDoc root);
38     public void endDocument();
39
40     /**
41      * Called each time a DTD <!element definition is read.
42      *
43      * @param name the name of the element
44      * @param typeName is the name to use for the attribute
45      * @param type the type (as a constant) of the element (for example
46      * TYPE_ELEMENT or TYPE_ATTLIST)
47      */

48     public void startElement(String JavaDoc uniqueName,
49                              String JavaDoc typeName, int type);
50     public void endElement();
51     
52     /**
53      * Does this element exist at this point? Either thru a startElement() creation,
54      * or thru an element() reference.
55      */

56     public boolean doesElementExist(String JavaDoc typeName);
57     
58     /**
59      * These methods are called to signal the beginning of the ( and )
60      * in an ELEMENT declaration. startGroupElements is called when
61      * an open parenthese is found and endGroupElements is called
62      * when the closed parenthese is found. The closing parenthese
63      * might be followed by the character *, + or ?. The instance
64      * value of the method call reflects this character value.
65      */

66     public void startGroupElements();
67     public void endGroupElements(int instance);
68     
69     /**
70      * Called each time a character , ( ) or | is found.
71      */

72     public void character(char c);
73     
74     /**
75      * Called for each name element found within the scope of an element
76      * (<!element (element1, element2, ...)>. The first element name doesn't
77      * generate a call to this method (@see startElement).
78      *
79      * @param name the name of the element defined within the <!element ...>
80      * declaration.
81      * @param instance has one of the three values: INSTANCE_0_1,
82      * INSTANCE_1, INSTANCE_0_N, INSTANCE_1_N
83      *
84      */

85     public void element(String JavaDoc uniqueName, String JavaDoc typeName,
86                         String JavaDoc attrName, String JavaDoc attrNamespace,
87                         int instance, boolean externalType, String JavaDoc defaultValue);
88     public void element(String JavaDoc uniqueName, String JavaDoc name, int instance);
89
90     public void setUnion(String JavaDoc uniqueName, String JavaDoc typeName, boolean value) throws Schema2BeansException;
91
92     public void addExtraDataNode(String JavaDoc uniqueName, String JavaDoc typeName, Object JavaDoc data) throws Schema2BeansException;
93     public void addExtraDataCurLink(Object JavaDoc data);
94     public void setExtension(String JavaDoc uniqueName, String JavaDoc typeName, String JavaDoc extendsName) throws Schema2BeansException;
95
96     public void nillable(boolean value);
97     
98     /**
99      * Called to request that the current graph node be of a certain
100      * Java class.
101      * @param javaType is the name of a Java class (eg, "java.lang.Integer", or "int").
102      */

103     public void javaType(String JavaDoc uniqueName, String JavaDoc name, String JavaDoc javaType);
104
105     public void setAbstract(String JavaDoc uniqueName, String JavaDoc name, boolean value);
106     /**
107      * Set the namespace that will be used by default in the documents.
108      */

109     public void setDefaultNamespace(String JavaDoc ns);
110
111     /**
112      * set a special property to some value.
113      */

114     public void setExtendedProperty(String JavaDoc uniqueName, String JavaDoc typeName, String JavaDoc propertyName,
115                                     Object JavaDoc value) throws Schema2BeansException;
116     
117     /**
118      * Establish a prefix guesser
119      */

120     public void setPrefixGuesser(PrefixGuesser guesser);
121 }
122
Popular Tags