public class XmlDataWorkspace
extends java.lang.Object
Constructor and Description |
---|
XmlDataWorkspace()
Creates a temporary workspace.
|
XmlDataWorkspace(Namespace ns)
Creates an XmlDataWorkspace using an existing namespace.
|
XmlDataWorkspace(Namespace ns,
boolean readOnly)
Creates a workspace using the specified namespace.
|
Modifier and Type | Method and Description |
---|---|
XmlAll |
all(XmlModelItem... items)
Creates an XmlAll definition in this workspace.
|
XmlAny |
any(int min,
int max,
java.lang.String process,
java.lang.String... namespaces)
Creates an XmlAny definition in this workspace.
|
XmlAnyType |
anyType()
Creates an XmlAnyType definition in this workspace.
|
XmlAttribute |
attribute(XmlDataAttributeTag aName)
Creates a global attribute definition in this workspace and adds it to the associated namespace.
|
XmlAttribute |
attribute(XmlDataAttributeTag aName,
boolean required)
Creates a local Attribute definition in this workspace.
|
XmlAttributeList |
attributeList(XmlAttributeItem... attributes)
Creates an XmlAttribute List in this workspace.
|
XmlAttributeRef |
attributeRef(XmlDataAttributeTag aName,
boolean required)
Creates an attribute reference in this workspace.
|
XmlChoice |
choice(int min,
int max,
XmlModelItem... items)
Creates an XmlChoice definition with a minOccur and a maxOccurs in this workspace.
|
XmlChoice |
choice(XmlModelItem... items)
Creates an XmlChoice definition with max/max occurs of 1/1 in this workspace.
|
XmlComplexType |
complexType(XmlContent model,
XmlAttributeList aList)
Creates an anonymous complexType definition in this workspace.
|
XmlComplexType |
complexType(XmlDataTypeTag typeName,
XmlContent content,
XmlAttributeList aList)
Creates a named (global) complexType definition in this workspace and adds it to the associated namespace.
|
XmlComplexTypeRef |
complexTypeRef(XmlDataTypeTag typeName)
Creates an XmlComplexTypeRef definition in this workspace.
|
void |
convertSchema(java.lang.String script)
Converts a script schema into a collection of document types stored in the workspace.
|
void |
convertSchema(java.lang.String script,
java.lang.String namespaceDecls)
Converts a script schema and namespace map into a collection of document types stored in the workspace.
|
void |
convertSchema(java.lang.String script,
XmlNamespaceMap map)
Converts a script schema and namespace map into a collection of document types stored in the workspace.
|
XmlElement |
element(XmlDataElementTag eTag,
XmlType model)
Creates a global element definition in this namespace and adds it to the associated namespace.
|
XmlElement |
element(XmlDataElementTag eTag,
XmlType model,
int min,
int max)
Creates a local element definition in this workspace.
|
XmlElementRef |
elementRef(XmlDataElementTag eTag,
int min,
int max,
boolean useFieldRef)
Creates an XmlElementRef definition in this workspace.
|
NSField |
getAttribute(XmlDataAttributeTag name)
Returns the NSField for a global attribute.
|
NSName |
getAttributeNSName(XmlDataAttributeTag name)
Computes the NSName for a global attribute.
|
NSField |
getElement(XmlDataElementTag name)
Returns the definition for a global element.
|
NSName |
getElementNSName(XmlDataElementTag name)
Computes the NSName for a global element.
|
java.lang.String |
getFolder()
Returns the folder name of the generated nodes.
|
NSNode |
getNodeByFullName(java.lang.String fullName)
Gets a node (typically an NSRecord or an NSField) by using its full name.
|
Namespace |
getNs()
Returns the namespace on which this workspace was created.
|
NSField |
getType(XmlDataTypeTag name)
Returns the NSField that defines the named type.
|
NSName |
getTypeNSName(XmlDataTypeTag name)
Computes the NSName for a named complex type
|
NSField |
getWrapper(XmlDataElementTag name)
Returns the wrapper for a global element.
|
NSName |
getWrapperNSName(XmlDataElementTag name)
Computes the NSName for a root element wrapper.
|
XmlSequence |
sequence(int min,
int max,
XmlModelItem... items)
Creates an XmlSequence definition with minOccurs and maxOccurs in this workspace.
|
XmlSequence |
sequence(XmlModelItem... items)
Creates an XmlSequence definition with min/max occurs of 1/1 in this workspace.
|
void |
setFolder(java.lang.String name)
Sets the folder name of the generated nodes.
|
XmlSimpleType |
simpleType()
Creates an XmlSimpleType definition in this workspace.
|
XmlSubstitution |
substitution(XmlDataElementTag... tags)
Defines a substitution group in this workspace.
|
XmlWrapper |
wrapper(XmlDataElementTag elementName,
boolean useFieldRef)
Creates an XmlWrapper (complexType with single member document element) in this workspace and adds it to the namespace.
|
public XmlDataWorkspace(Namespace ns)
ns
- the com.wm.lang.ns.Namespace to accesspublic XmlDataWorkspace()
public XmlDataWorkspace(Namespace ns, boolean readOnly)
ns
- the namespacereadOnly
- if true, no components may be added to the namespacepublic Namespace getNs()
public void convertSchema(java.lang.String script, java.lang.String namespaceDecls)
script
- the schema specified in script form. See XmlDataSchemaConverter
for the format.namespaceDecls
- namespace declarations specified as a String containing prefix URI pairspublic void convertSchema(java.lang.String script)
script
- the schema specified in script form. See XmlDataSchemaConverter
for the format.public void convertSchema(java.lang.String script, XmlNamespaceMap map)
script
- the schema specified in script form. See XmlDataSchemaConverter
for the format.map
- a namespace mappublic XmlAll all(XmlModelItem... items)
items
- a list of member items (XmlElements and XmlElementRefs)public XmlAny any(int min, int max, java.lang.String process, java.lang.String... namespaces)
min
- minOccursmax
- maxOccursprocess
- processContents (strict, lax or skip)namespaces
- ##any; ##other name; name1 name2 ... (which may include ##local)public XmlAnyType anyType()
public XmlAttribute attribute(XmlDataAttributeTag aName)
aName
- the attribute namepublic XmlAttribute attribute(XmlDataAttributeTag aName, boolean required)
aName
- the attribute namerequired
- boolean flag indicating requiredpublic XmlAttributeList attributeList(XmlAttributeItem... attributes)
attributes
- a list of XmlAttributes and XmlAttributeRefs)XmlAttributeList(XmlDataWorkspace, XmlAttributeItem...)
public XmlAttributeRef attributeRef(XmlDataAttributeTag aName, boolean required)
aName
- the name of the referenced attributerequired
- boolean flag indicating required attributeXmlAttributeRef(XmlDataWorkspace, XmlDataAttributeTag, boolean)
public XmlChoice choice(XmlModelItem... items)
items
- a list of content items (XmlElement, XmlElementREf, XmlAny, XmlChoice, and XmlSequence.XmlChoice(XmlDataWorkspace, int, int, XmlModelItem...)
public XmlChoice choice(int min, int max, XmlModelItem... items)
min
- minOccursmax
- maxOccursitems
- a list of content items (XmlElement, XmlElementRef, XmlAny, XmlChoice, and XmlSequence.XmlChoice(XmlDataWorkspace, int, int, XmlModelItem...)
public XmlComplexType complexType(XmlContent model, XmlAttributeList aList)
model
- a subclass of XmlGroup defining the content model (XmlAll, XmlChoice, or XmlSequence).aList
- an XmlAttributeListXmlComplexType(XmlDataWorkspace, XmlContent, XmlAttributeList)
public XmlComplexType complexType(XmlDataTypeTag typeName, XmlContent content, XmlAttributeList aList)
typeName
- the global name of the typecontent
- the content model: an instance of XmlSequence, XmlChoice, XmlAll, or XmlSimpleTypeaList
- an AttributeListXmlComplexType(XmlDataWorkspace, XmlDataTypeTag, XmlContent, XmlAttributeList)
public XmlComplexTypeRef complexTypeRef(XmlDataTypeTag typeName)
typeName
- the name of the referenced typeXmlComplexTypeRef(XmlDataWorkspace, XmlDataTypeTag)
public XmlElement element(XmlDataElementTag eTag, XmlType model)
eTag
- the element global namemodel
- an XmlType (XmlComplexType, XmlComplexTypeRef, XmlAnyType, XmlSimpleType)XmlElement(XmlDataWorkspace, XmlDataElementTag, XmlType)
public XmlElement element(XmlDataElementTag eTag, XmlType model, int min, int max)
eTag
- the name of the elementmodel
- an XmlType (XmlComplexType, XmlComplexTypeRef, XmlAnyType, XmlSimpleType)min
- minOccursmax
- maxOccursXmlElement(XmlDataWorkspace, XmlDataElementTag, XmlType, int, int)
public XmlElementRef elementRef(XmlDataElementTag eTag, int min, int max, boolean useFieldRef)
eTag
- the name of the referenced global elementmin
- minOccursmax
- maxOccursuseFieldRef
- boolean flag indication this is an NSFieldRef (rather than an NSRecordRef). Should be set true only when the
referenced global element has simple type.XmlElementRef(XmlDataWorkspace, XmlDataElementTag, int, int, boolean)
public NSField getAttribute(XmlDataAttributeTag name)
name
- an XmlDataAttributeTagpublic NSName getAttributeNSName(XmlDataAttributeTag name)
name
- the attribute namepublic NSField getElement(XmlDataElementTag name)
name
- an XmlDataElementTagpublic NSName getElementNSName(XmlDataElementTag name)
name
- the element namepublic java.lang.String getFolder()
public NSNode getNodeByFullName(java.lang.String fullName)
fullName
- the full namespace name, e.g., myFolders.myFields:Addresspublic NSField getWrapper(XmlDataElementTag name)
name
- an XmlDataElementTagpublic NSName getWrapperNSName(XmlDataElementTag name)
name
- the element namepublic NSField getType(XmlDataTypeTag name)
name
- an XmlDataTypeTagpublic NSName getTypeNSName(XmlDataTypeTag name)
name
- the type namepublic XmlSequence sequence(XmlModelItem... items)
items
- a list of XmlElements, XmlElementRefs, XmlAnys, XmlSequences, and XmlChoicesXmlSequence(XmlDataWorkspace, int, int, XmlModelItem...)
public XmlSequence sequence(int min, int max, XmlModelItem... items)
min
- minOccursmax
- maxOccursitems
- a list of XmlElements, XmlElementRefs, XmlAnys, XmlSequences, and XmlChoicesXmlSequence(XmlDataWorkspace, int, int, XmlModelItem...)
public void setFolder(java.lang.String name)
name
- the name of the folder (as used in generated NSNames)public XmlSimpleType simpleType()
XmlSimpleType(XmlDataWorkspace)
public XmlSubstitution substitution(XmlDataElementTag... tags)
tags
- a list of XmlContentTags. The first tag is the head of the substitution group. The remaining tags identify the members.XmlSubstitution(XmlDataWorkspace, XmlDataElementTag...)
public XmlWrapper wrapper(XmlDataElementTag elementName, boolean useFieldRef)
elementName
- the name of the root elementuseFieldRef
- a boolean set to true when the referenced element has SimpleTypeXmlWrapper(XmlDataWorkspace, XmlDataElementTag, boolean)