public class Schema extends Object
| Constructor and Description |
|---|
Schema(SchemaConfig xml,
SchemaSystem schemaSystem)
Constructs a Schema object using previously saved data.
|
Schema(String namespace,
SchemaSystem schemaSystem)
Constructs a blank new Schema for the given namespace in the given
SchemaSystem.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addType(ComplexType type)
Add a ComplexType to this Schema.
|
String |
getNamespace()
Getter for the namespace of this Schema.
|
Particle |
getParticle(String name)
Get a global particle by its name.
|
String |
getPrefixForNamespace(String namespace)
Gets the prefix used in this schema for a different namespace, if one
exists.
|
SchemaSystem |
getSystem()
Getter for the SchemaSystem that contains this Schema.
|
Type |
getType(String name)
Get a Type contained in this schema by name.
|
Particle |
newAttribute(String name)
Create and add a new global attribute for this schema.
|
Particle |
newElement(String name)
Create and add a new root element for this schema.
|
void |
putPrefixForNamespace(String prefix,
String namespace)
Set the prefix used in this schema for a different namespace.
|
void |
save(SchemaConfig xml)
Save the Schema to an XmlObject.
|
String |
toString() |
void |
validate(Context context)
Validates an XML document contained in a given Context object.
|
public Schema(String namespace, SchemaSystem schemaSystem)
namespace - The namespace for the new schema.schemaSystem - The SchemaSystem in which to place the newly created Schema.public Schema(SchemaConfig xml, SchemaSystem schemaSystem)
xml - The XmlObject to which data has previously been saved.schemaSystem - The SchemaSystem in which to place the newly created Schema.public void save(SchemaConfig xml)
xml - A blank XmlObject to save to.public void addType(ComplexType type)
type - The ComplexType to be added.public String getNamespace()
public String getPrefixForNamespace(String namespace)
namespace - Another namespace to get the prefix for.public void putPrefixForNamespace(String prefix, String namespace)
prefix - The prefix to be used.namespace - The namespace to use the prefix for.public Type getType(String name)
name - The name of a contained Type.public Particle newElement(String name)
name - The name to give the newly created element.public Particle newAttribute(String name)
name - The name to give the newly created attribute.public void validate(Context context) throws org.apache.xmlbeans.XmlException
context - A Context object containing the XML data to be validated, and
other needed contextual variables.org.apache.xmlbeans.XmlException - On unresolvable validation error.public SchemaSystem getSystem()
Copyright © 2019. All Rights Reserved.