Class Factory
java.lang.Object
com.sun.xml.rpc.processor.modeler.j2ee.xml.Factory
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
javaWsdlMappingFactory
This factory class creates/loads Java bean and the corresponding DOM node.
The generated factory code extends this class.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddImportedFileInfo(String filename, String nsprefix, String nsURI) Store the prefix and the namespace information for each imported fileprotected AttrcreateAttribute(String name, Element parentElement) Create a new attribute and add it to the parent elementcreateDOMElementFromComplexType(String classname, String elementName) Create a new DOM element and the corresponding Java bean.createDOMElementFromSimpleType(String classname, String elementName) Create a new DOM element and the corresponding Java bean.createRootDOMFromComplexType(String classname, String rootElementName) Create a new root element from a complex typecreateRootDOMFromSimpleType(String classname, String rootElementName) Create a new root element from a simple typeprotected TextcreateText(Element parentElement, String value) Create a new Text node and add it to the parent elementprotected ElementcreateXMLElementAndText(String elementName, String elementValue) Create a new element and its text nodeGet the DTD file nameGet the encoding that will be used to output the xml documentgetEncodingTag(String encodingTag) Get the IANA value to be used in the XML declarationGet the namespace URIGet the name of the Java packageGet the public identifier in the DOCTYPEGet the name of the XML instance documentGet the XSD file nameloadDocument(String classname, String xmlFile) Load an existing instance documentloadDocument(String classname, String xmlFile, boolean validate) loadDocument(String classname, Element element) Load an existing instance document from an Element.loadDocument(String classname, InputSource source) Load an existing instance document from an InputSourceloadDocument(String classname, InputSource source, boolean validate) protected BaseTypenewInstance(Node node, String className) Create a new Java object for the input Nodevoidprint(PrintWriter writer, String prefix) voidsave()Save the DOM to diskvoidSave the DOM to the specified file namevoidsetDTDFileName(String dtdFilename) Set the DTD file name so that a DOCTYPE will be generated If this is set, the XSD filename should not be set.voidsetEncoding(String encoding) Set the encoding that will be used to output the xml documentvoidsetEncodingTag(String encodingTag) Set the IANA value to be used in the XML declarationvoidsetNamespaceURI(String namespaceURI) Set the namespace URI for this XSD file.voidsetPackageName(String packageName) Set the name of the Java packagevoidsetPublicId(String publicId) Set the public identifier in the DOCTYPEvoidsetXMLFilename(String filename) Set the name of the XML instance documentvoidsetXSDFileName(String xsdFilename) Set the XSD file name.
-
Field Details
-
xmlFile
-
packageName
-
document
-
encoding
-
encodingTag
-
dtdFileName
-
dtdPublicId
-
xsdFileName
-
xsdNamespaceURI
-
importedFileHashtable
-
-
Constructor Details
-
Factory
public Factory()
-
-
Method Details
-
setPackageName
Set the name of the Java package -
getPackageName
Get the name of the Java package -
setXMLFilename
Set the name of the XML instance document -
getXMLFilename
Get the name of the XML instance document -
setEncoding
Set the encoding that will be used to output the xml document- Parameters:
encoding- the encoding value for the OutputStreamWriter
-
getEncoding
Get the encoding that will be used to output the xml document -
setEncodingTag
Set the IANA value to be used in the XML declaration- Parameters:
encodingTag- the encoding tag to be used in the XML declaration
-
getEncodingTag
Get the IANA value to be used in the XML declaration -
setDTDFileName
Set the DTD file name so that a DOCTYPE will be generated If this is set, the XSD filename should not be set. -
getDTDFileName
Get the DTD file name -
setPublicId
Set the public identifier in the DOCTYPE -
getPublicId
Get the public identifier in the DOCTYPE -
setXSDFileName
Set the XSD file name. If this is set, the DTD filename should not be set -
getXSDFileName
Get the XSD file name -
setNamespaceURI
Set the namespace URI for this XSD file. -
getNamespaceURI
Get the namespace URI -
addImportedFileInfo
Store the prefix and the namespace information for each imported file- Parameters:
filename- The filename for the imported schemansprefix- The prefix for the imported schemarnsURI- The namespace URI for the imported schema
-
loadDocument
Load an existing instance document -
loadDocument
-
loadDocument
Load an existing instance document from an InputSource -
loadDocument
-
loadDocument
Load an existing instance document from an Element. -
save
Save the DOM to the specified file name -
print
-
save
public void save()Save the DOM to disk -
createRootDOMFromComplexType
Create a new root element from a complex type- Parameters:
classname- - the name of the Java class that corresponds to the root elementrootElementName- - the root element name, it might contain a prefix e.g. po:purchaseOrder or purchaseOrder- Returns:
- ComplexType a Java bean that extends the ComplexType class
-
createRootDOMFromSimpleType
Create a new root element from a simple type- Parameters:
classname- - the name of the Java class that corresponds to the root elementrootElementName- - the root element name, it might contain a prefix e.g. po:purchaseOrder or purchaseOrder- Returns:
- SimpleType a Java bean that extends the SimpleType class
-
createDOMElementFromComplexType
Create a new DOM element and the corresponding Java bean. Called by the generated Factory class.- Parameters:
classname- The name of the Java bean that corresponds to this elementelementName- The name of the element- Returns:
- ComplexType A Java bean that extends the ComplexType class
-
createDOMElementFromSimpleType
Create a new DOM element and the corresponding Java bean. Called by the generated Factory class.- Parameters:
classname- The name of the Java bean that corresponds to this elementelementName- The name of the element- Returns:
- SimpleType A Java bean that extends the ComplexType class
-
newInstance
Create a new Java object for the input Node- Parameters:
node- - can be an element or an attributeclassName- - the corresponding Java class name
-
createXMLElementAndText
Create a new element and its text node- Parameters:
elementName- - the name of the new elementelementValue- - the value of the new element
-
createAttribute
Create a new attribute and add it to the parent element -
createText
Create a new Text node and add it to the parent element
-