|
WebLogic Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.schema.SOMObject | +--com.bea.schema.SOMSchema
<schema> The SOMSchema object is the building block for the Schema Object Model, SOM. The top level <schema> element is represented by the SOMSchema object and all sub-elements are linked underneath this object.
A schema is represented in XML by one or more schema documents, that is, one or more schema element information items. A schema document contains representations for a collection of schema components, e.g. type definitions and element declarations, which have a common {target namespace}.
The SOM allows the output of XML but is represented internally by a hierarchy of objects known as the Schema Object Model. SOMSchema is the object that represents the top level schema element to which everything must be added.
Field Summary | |
static java.lang.String |
NAMESPACE_2001
|
static java.lang.String |
NAMESPACE_OCT2000
|
Constructor Summary | |
SOMSchema()
Create an empty top schema level object |
|
SOMSchema(org.xml.sax.InputSource inputSource,
boolean canonical,
boolean debugMessages)
Load a schema from an XML instance document in a file. |
|
SOMSchema(java.io.Reader xml)
Load a schema from stringified XML using the default SAX parser. |
|
SOMSchema(java.lang.String xmlString)
Load a schema from serialized XML using the default SAX parser. |
|
SOMSchema(java.lang.String xmlString,
boolean canonical,
boolean debugMessages)
Load a schema from stringified XML using the default SAX parser. |
|
SOMSchema(java.lang.String xmlString,
java.lang.String encoding)
Load a schema from stringified XML using the default SAX parser. |
|
SOMSchema(org.xml.sax.XMLReader parser,
org.xml.sax.InputSource inputSource,
boolean canonical,
boolean debugMessages)
Load a schema from an XML instance document in a file. |
Method Summary | |
SOMAnnotation |
addAnnotation()
create a new empty annotation element within this schema. |
SOMAnnotation |
addAnnotation(SOMAnnotation annotation)
add an annotation to the schema tree. |
void |
addAttribute(java.lang.String name,
java.lang.String value)
add attributes to the <schema> element. |
SOMAttribute |
addAttributeElement(SOMAttribute child)
Adds a previously created <attribute> object to the root of the schema object model. |
SOMAttribute |
addAttributeElement(java.lang.String name)
Creates a SOMAttribute object with the given name and adds the <attribute> to the root level of this schema. |
SOMAttributeGroup |
addAttributeGroup(SOMAttributeGroup child)
Adds a previously created <attributeGroup> object to the root of the schema object model. |
SOMAttributeGroup |
addAttributeGroup(java.lang.String name)
Creates a SOMAttributeGroup object with the given name and adds the <attributeGroup> to the root level of this schema. |
SOMComplexType |
addComplexType(SOMComplexType child)
Adds the complexType to the root level of this schema. |
SOMComplexType |
addComplexType(java.lang.String name)
Creates a SOMComplexType object with the given name and adds the |
SOMDocumentation |
addDocumentation(java.lang.String info)
adds a documentation element to a new annotation element for this schema. |
SOMElement |
addElement(SOMElement child)
Adds a previously created <element> object to the root of the schema object model. |
SOMElement |
addElement(java.lang.String name)
Creates a SOMElement object with the given name and adds the <element> to the root level of this schema. |
SOMGroup |
addGroup(SOMGroup child)
Adds a previously created <roup> object to the root of the schema object model. |
SOMGroup |
addGroup(java.lang.String name)
Creates a SOMGroup object with the given name and adds the <group> to the root level of this schema. |
SOMSimpleType |
addSimpleType(SOMSimpleType child)
Adds the simpleType to the root level of this schema. |
SOMSimpleType |
addSimpleType(java.lang.String name)
Creates a SOMSimpleType object with the given name and adds the object to the root level of this schema. |
IDocument |
createDefaultDocument(DefaultDocumentOptions options)
create an XML instance document template based on this schema model. |
java.util.Iterator |
getAnnotations()
Returns an Iterator over all the annotations contained at the root level of this schema. |
java.util.Iterator |
getAttributeElements()
Returns an Iterator over all the attributes contained at the root level of this schema. |
java.util.Iterator |
getAttributeGroups()
|
java.util.Iterator |
getAttributes()
Returns an Iterator over all the attributes in the schema element. |
java.util.Iterator |
getComplexTypes()
Returns an Iterator over all the complexTypes contained at the root level of this schema. |
java.lang.String |
getDefaultNameSpace()
get the schema xmlns:xsd attribute. |
SOMElement |
getElement(java.lang.String locationString)
Lookup an element within this schema. |
java.util.Iterator |
getElements()
Returns an Iterator over all the elements contained at the root level of this schema. |
java.util.Iterator |
getGroups()
Returns an Iterator over all the groups contained at the root level of this schema. |
java.lang.String |
getID()
|
static java.lang.String |
getLocalPartFromName(java.lang.String name)
return the local name portion of a qualified name. |
static java.lang.String |
getPrefixFromName(java.lang.String name)
return the prefix portion of a qualified name, or null if the given name is not qualified. |
java.util.Iterator |
getSimpleTypes()
Returns an Iterator over all the simpleTypes contained at the root level of this schema. |
java.lang.String |
getTargetNamespace()
get the targetNamespace for this schema, or null if no targetNamespace was specified. |
boolean |
hasUnresolvedReferences()
|
boolean |
hasUnresolvedTypes()
|
boolean |
isValid(org.w3c.dom.Document doc,
java.util.List errorList)
Validates an XML Document against an XML Schema. |
boolean |
isValid(IDocument doc,
java.util.List errorList)
Validates an XML Document against an XML Schema. |
boolean |
isValid(org.w3c.dom.Node rootElement,
java.util.List errorList)
Validates an XML Document against an XML Schema. |
boolean |
isValidatingContent()
current content validation setting. |
SOMAttributeGroup |
lookupAttrGrpReference(java.lang.String registeredName)
Returns a reference to an attributeGroup previously added to this schema object. |
SOMElement |
lookupElement(java.lang.String registeredName)
Returns a reference to an SOMElement previously added to this schema object. |
protected SOMObject |
lookupObject(java.lang.String name,
java.util.Map map)
Lookup a SOMObject by name from the given Map. |
SOMReference |
lookupReference(java.lang.String registeredName)
Returns a reference to an element previously added to this schema object. |
SOMType |
lookupTypeReference(java.lang.String registeredTypeName)
Returns a reference to a type previously added to this schema object. |
static void |
main(java.lang.String[] args)
|
SOMAnnotation |
removeAnnotation(SOMAnnotation note)
remove an annotation and all of its children from the root level of this schema |
SOMAttribute |
removeAttribute(java.lang.String name)
remove an attribute from the root level of this schema |
SOMComplexType |
removeComplexType(java.lang.String name)
remove a complexType from the root level of this schema |
SOMElement |
removeElement(java.lang.String name)
remove an element from the root level of this schema |
SOMGroup |
removeGroup(java.lang.String name)
remove an group from the root level of this schema |
SOMSimpleType |
removeSimpleType(java.lang.String name)
remove a simpleType from the root level of this schema |
void |
resolveReferences()
Resolve unresolved elements in this schema. |
void |
resolveTypes()
Resolve unresolved element types in this schema. |
void |
setContentValidation(boolean value)
toggle element and attribute content validation. |
void |
setDefaultNamespace(java.lang.String xmlns_xsd)
manually override the XMLSchema namespace - NOT RECOMMENDED. |
void |
toXML(java.io.Writer rtn,
int indent)
For debugging, display, and printing purposes, the XML Schema Object model can be represented as a character string. |
Methods inherited from class com.bea.schema.SOMObject |
addPrefixMapping,
attributesToXML,
collectEffectivePrefixMappings,
doIndent,
getContainmentXPath,
getEffectivePrefixMappings,
getID_UQ,
getParent,
getParentName,
getParentSchema,
getPrefixForTargetNamespace,
getURIForPrefix,
isCircularReference,
isSchemaChild,
namespacePrefixesToXML,
removeNamespaceQualifier,
removePrefixMapping,
setIndent,
setParent,
toString,
toXML,
toXML,
toXML,
trace,
trace |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String NAMESPACE_OCT2000
public static final java.lang.String NAMESPACE_2001
Constructor Detail |
public SOMSchema()
public SOMSchema(java.lang.String xmlString) throws org.xml.sax.SAXException
xmlString
- the XML in parsable string formatpublic SOMSchema(java.lang.String xmlString, java.lang.String encoding) throws org.xml.sax.SAXException, java.io.UnsupportedEncodingException
xmlString
- the XML in parsable string formatencoding
- public SOMSchema(java.lang.String xmlString, boolean canonical, boolean debugMessages) throws org.xml.sax.SAXException
xmlString
- the XML in parsable string formatcanonical
- for future usedebugMessages
- print debug messages for loading InputSource to SOMSchema to stdoutpublic SOMSchema(java.io.Reader xml) throws org.xml.sax.SAXException
public SOMSchema(org.xml.sax.InputSource inputSource, boolean canonical, boolean debugMessages) throws org.xml.sax.SAXException
SOMSchema mySchema = null; java.io.Reader myInput; ... org.xml.sax.InputSource myInputSource = new org.xml.sax.InputSource(myInput); try { mySchema = new SOMSchema(myInputSource, false, false); } catch (org.xml.sax.SAXException se) { System.err.println(se.getMessage()); } catch ( Exception e ) { e.printStackTrace(); }
inputSource
- the input source to parsecanonical
- for future usedebugMessages
- print debug messages for loading InputSource to SOMSchema to stdoutpublic SOMSchema(org.xml.sax.XMLReader parser, org.xml.sax.InputSource inputSource, boolean canonical, boolean debugMessages) throws org.xml.sax.SAXException
parser
- a SAX parserinputSource
- the input source to parsecanonical
- for future usedebugMessages
- print debug messages for loading InputSource to SOMSchema to stdoutMethod Detail |
public static void main(java.lang.String[] args)
public void addAttribute(java.lang.String name, java.lang.String value)
name
- attribute namevalue
- attribute valuepublic SOMAttribute addAttributeElement(java.lang.String name)
name
- The name attribute for the created <attribute>public SOMAttribute addAttributeElement(SOMAttribute child)
child
- public SOMAttributeGroup addAttributeGroup(java.lang.String name)
name
- The name attribute for the created <attributeGroup>public SOMAttributeGroup addAttributeGroup(SOMAttributeGroup child)
child
- public SOMGroup addGroup(java.lang.String name)
name
- The name attribute for the created <group>public SOMGroup addGroup(SOMGroup child)
child
- public SOMElement addElement(java.lang.String name)
name
- The name attribute for the created <element>public SOMElement addElement(SOMElement child)
child
- public SOMComplexType addComplexType(java.lang.String name)
name
- public SOMComplexType addComplexType(SOMComplexType child)
child
- the complexType to addpublic SOMSimpleType addSimpleType(java.lang.String name)
name
- public SOMSimpleType addSimpleType(SOMSimpleType child)
child
- the simpleType to addpublic SOMDocumentation addDocumentation(java.lang.String info)
SOMSchema mySchema ... ... SOMAnnotation note = mySchema.addAnnotation(); note.addDocumentation(info);
info
- The documentation string to be addedpublic SOMAnnotation addAnnotation()
public SOMAnnotation addAnnotation(SOMAnnotation annotation)
annotation
- a previously created annotationpublic java.lang.String getID()
public java.lang.String getDefaultNameSpace()
public void setDefaultNamespace(java.lang.String xmlns_xsd)
xmlns_xsd
- namespace URLpublic java.util.Iterator getComplexTypes()
public java.util.Iterator getSimpleTypes()
public java.util.Iterator getElements()
public SOMElement getElement(java.lang.String locationString)
Virtual Path nodes must be separated by the forward slash, "/"
locationString
- a virtual element path where nodes are separated by the forward slash, "/"public java.util.Iterator getGroups()
public java.util.Iterator getAttributeElements()
public java.util.Iterator getAttributes()
public java.util.Iterator getAttributeGroups()
public boolean hasUnresolvedReferences()
public boolean hasUnresolvedTypes()
public void resolveReferences()
public void resolveTypes()
public java.util.Iterator getAnnotations()
public java.lang.String getTargetNamespace()
public SOMComplexType removeComplexType(java.lang.String name)
name
- name the complexTypepublic SOMSimpleType removeSimpleType(java.lang.String name)
name
- name the simpleTypepublic SOMElement removeElement(java.lang.String name)
name
- name the elementpublic SOMGroup removeGroup(java.lang.String name)
name
- name the grouppublic SOMAttribute removeAttribute(java.lang.String name)
name
- name the attributepublic SOMAnnotation removeAnnotation(SOMAnnotation note)
note
- The annotation object to be removedpublic SOMType lookupTypeReference(java.lang.String registeredTypeName)
registeredTypeName
- The value of the "name" attribute for the registered type.public SOMReference lookupReference(java.lang.String registeredName)
registeredBasicName
- The value of the "name" attribute for the registered element.public SOMElement lookupElement(java.lang.String registeredName)
registeredBasicName
- The value of the "name" attribute for the registered attributeGroup element.protected SOMObject lookupObject(java.lang.String name, java.util.Map map)
public static java.lang.String getPrefixFromName(java.lang.String name)
public static java.lang.String getLocalPartFromName(java.lang.String name)
public SOMAttributeGroup lookupAttrGrpReference(java.lang.String registeredName)
registeredBasicName
- The value of the "name" attribute for the registered attributeGroup element.public boolean isValidatingContent()
public void setContentValidation(boolean value)
value
- use false to ignore document contentpublic boolean isValid(org.w3c.dom.Document doc, java.util.List errorList)
The error list is cleared before beginning the validation. The List implementation used must support the clear() method.
Elements of the list are instances of the class SOMValidationException.
doc
- the document instance to be validatederrorList
- A list of SOMValidationExceptionpublic boolean isValid(IDocument doc, java.util.List errorList)
The error list is cleared before beginning the validation. The List implementation used must support the clear() method.
Elements of the list are instances of the class SOMValidationException.
doc
- the document instance to be validatederrorList
- A list of SOMValidationExceptionpublic boolean isValid(org.w3c.dom.Node rootElement, java.util.List errorList)
The error list is cleared before beginning the validation. The List implementation used must support the clear() method.
Elements of the list are instances of the class SOMValidationException.
doc
- the document instance to be validatederrorList
- A list of SOMValidationExceptionpublic void toXML(java.io.Writer rtn, int indent) throws java.io.IOException
indent
- Indent levelpublic IDocument createDefaultDocument(DefaultDocumentOptions options)
options
- options must include a root element name
|
WebLogic Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |