Oracle9i XML Reference Release 1 (9.0.1) Part Number A88899-01 |
|
public abstract class CGDocument extendsoracle.xml.classgen.CGNode
java.lang.Object | +--oracle.xml.classgen.CGNode
| +--oracle.xml.classgen.CGDocument
Serves as the base document class for the DTD compiler generated classes
protected CGDocument()
protected CGDocument(java.lang.String doctype, oracle.xml.parser.v2.DTD dtd)
Constructor for the Root element of the DTD
doctype
- Name of the root Element of the DTD
dtd
- The DTD used to generate the classes
protected void print(java.io.OutputStream out)
Prints the constructed XML Document
out
- Output stream to which the document will be printed
InvalidContentException
- Throw exception if the document's content do not match the grammer specified by DTD (The validation mode should be set to TRUE)
oracle.xml.classgen.ClassGenerator
protected void print(java.io.OutputStream out, java.lang.String enc)
Prints the constructed XML Document
out
- Output stream to which the document will be printed
enc
- Encoding of the output stream
InvalidContentException
- Throw exception if the document's content do not match the grammer specified by DTD (The validation mode should be set to TRUE)
oracle.xml.classgen.ClassGenerator
public abstract class CGNode extends java.lang.Object java.lang.Object | +--oracle.xml.classgen.CGNode
CGDocument
Serves as the base class for nodes generated by the DTD compiler
protected boolean isValidating
Boolean to indicate the validating mode
protected CGNode(java.lang.String elementName)
Constructor for the Elements of the DOM Tree
elementName
- Name of the element
protected void addCDATASection(java.lang.String theData)
Adds CDATA Section to the Element
theData
- Text to be added as CDATA Section to the element
InvalidContentException
- Thrown if theData
has illegal characters (validation must be set to TRUE)
oracle.xml.classgen.ClassGenerator
protected void addData(java.lang.String theData)
Adds PCDATA to the Element
theData
- Text to be added to the element
InvalidContentException
- Thrown if theData
has illegal characters (validation must be set to TRUE)
oracle.xml.classgen.ClassGenerator
protected void addNode(CGNode
theNode)
Adds a node as a child to the element
theNode
- The node to be added as child
InvalidContentException
- Thrown if the Node cannot be added as child as per Content Model of the element (validation must be set to TRUE)
oracle.xml.classgen.ClassGenerator
protected CGDocument
getCGDocument()
Gets the base document (root Element)
The base CGDocument
protected abstract oracle.xml.parser.v2.DTD getDTDNode()
Gets the static DTD from the base document
DTD stored in base CGDocument
protected void setAttribute(java.lang.String attName, java.lang.String value)
Sets the value of the Attribute
attName
- Name of the attribute
value
- Value of the attribute
public void setDocument(CGDocument
d)
Sets the base document (root Element)
d
- Base CGDocument
protected void storeID(java.lang.String attName, java.lang.String id)
Store this value for an ID identifier, so that we can later verify IDREF values
attName
- Name of the ID Attribute
id
- Value of the ID
protected void storeIDREF(java.lang.String attName, java.lang.String idref)
Store this value for an IDREF identifier, so that we can later verify, if an corresponding ID was defined.
attName
- Name of the IDREF Attribute
idref
- Value of the IDREF
protected void validateContent()
Checks if the content of the element is valid as per the Content Model specified in DTD
True if content is valid, else false
protected boolean validEntity(java.lang.String entity)
Checks if the ENTITY identifier is valid
name
- value of the Entity Attribute
True if Entity is valid, else false
protected boolean validID(java.lang.String name)
Checks if the ID identifier is valid
name
- value of the ID Attribute
True if ID is valid, else false
protected boolean validNMTOKEN(java.lang.String name)
Checks if the NMTOKEN identifier is valid
name
- value of the Nmtoken Attribute
True if Nmtoken is valid, else false
public abstract class CGXSDElement oracle.xml.classgen.CGXSDElement
This class serves as the base class for the all the generated classes corresponding to the XML Schema generated by Schema Class Generator
protected java.lang.Object type
public CGXSDElement()
protected void addAttribute(java.lang.String attName, java.lang.String attValue)
Add the attribute of a given node to the hashtable.
attName
- the attribute name
attValue
- the attribute value
protected void addElement(java.lang.Object elem)
Add the elements of a given element node to the vector correspondig to the elements.
elem
- the object which needs to be added
public java.util.Hashtable getAttributes()
Return the attributes
attributes the hashtable containing attribute name and value
public java.util.Vector getChildElements()
Get the vector having all the local elements
elemChild vector
public java.lang.String getNodeValue()
Return the node value
public java.lang.Object getType()
Return the type
public void print(oracle.xml.parser.v2.XMLOutputStream out)
Print an element node
out
- the stream where the output is printed
public void printAttributes(oracle.xml.parser.v2.XMLOutputStream out, java.lang.String name)
Print an attribute node
out
- the stream where the output is printed
name
- the attribute name
protected void setNodeValue(java.lang.String value)
Set the node value of an element
value
- the node value
public class DTDClassGenerator extends java.lang.Object java.lang.Object | +--oracle.xml.classgen.DTDClassGenerator
This class is used by the DTD compiler to generate classes
public DTDClassGenerator()
Default constructor for DTDClassGenerator.
public void generate(oracle.xml.parser.v2.DTD dtd, java.lang.String doctype)
Traverses the DTD with element doctype
as root and generates Java classes
DTD
- The DTD used to generate the classes
doctype
- Name of the root Element
protected void printDocumentMethods()
public void setGenerateComments(boolean comments)
Switch to determine whether to generate java doc comments Default - TRUE
comments
- boolean flag
public void setJavaPackage(java.util.Vector packageName)
Sets the package for the classes generated Default - No package
packageName
- Name of the package
public void setOutputDirectory(java.lang.String dir)
Sets the output directory where the java source code for the DTD are generated. Default - current directory
dir
- Output directory
public void setSerializationMode(boolean yes)
Switch to determine if the DTD should be saved as a serialized object or as text file. Serializing the DTD improves the performance when the generated classes are used to author XML files. Default - FALSE (DTD is saved a text file)
yes
- boolean flag
public void setValidationMode(boolean yes)
Switch to determine whether the classes generated should validate the XML Document being constructed Default - TRUE
yes
- boolean flag
public class InvalidContentException extends java.lang.Exception java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--oracle.xml.classgen.InvalidContentException
java.io.Serializable
Definition of InvalidContentException thrown by dtdcompiler classes
public InvalidContentException()
public InvalidContentException(java.lang.String s)
public class oracg extends java.lang.Object java.lang.Object | +--oracle.xml.classgen.oracg
The oracg class provides a command-line interface to generate java classes corresponding to the DTD or XML Schema java oracle.xml.classgen.oracg options are: -h Prints the help message text -d The input file is a DTD file or DTD based XML file -s The input file is a Schema file or Schema based XML file -o The directory name where java source is generated -p The package name(s) of the generated java classes. -c Generate comments for the generated java source code.
public oracg()
Default constructor for oracg
public static void main(java.lang.String[] args)
The main method
public class SchemaClassGenerator extends java.lang.Object java.lang.Object | +--oracle.xml.classgen.SchemaClassGenerator
This class generates the classes corresponding to an XML Schema.
public SchemaClassGenerator()
Default empty constructor for Schema Class Generator
public SchemaClassGenerator(java.lang.String fileName)
The constructor for Schema Class Generator
fileName
- the input XML Schema
public void generate(oracle.xml.parser.schema.XMLSchema schema)
Generate the Schema classes corresponding to top level elements, simpleType elements and complexType elements by calling createSchemaClass on each of these nodes.
XML
- Schema object
public void setGenerateComments(boolean comments)
Switch to determine whether to generate java doc comments The default setting is true
comments
- boolean flag
public void setJavaPackage(oracle.xml.parser.schema.XMLSchema schema, java.util.Vector pkgName)
Sets the Java package names corresponding to Namespaces. The Namespaces defined in the schema are queried. The Number of namespaces defined in the schema should match the number of package names given by the user through command line else an error is thrown. For each namespace, a user-defined package name is assigned.
schema
- XMLSchema
pkgName
- A vector containing user defined pacake names given through command line.
public void setOutputDirectory(java.lang.String dir)
Sets the output directory where the java source code for the Schema class are generated. Default - current directory
dir
- Output directory
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|