com.eviware.soapui.impl.wadl.inference.schema
Class Schema

java.lang.Object
  extended by com.eviware.soapui.impl.wadl.inference.schema.Schema

public class Schema
extends java.lang.Object

Represents an inferred schema for a single namespace.

Author:
Dain Nilsson

Constructor Summary
Schema(com.eviware.soapui.inferredSchema.SchemaConfig xml, SchemaSystem schemaSystem)
          Constructs a Schema object using previously saved data.
Schema(java.lang.String namespace, SchemaSystem schemaSystem)
          Constructs a blank new Schema for the given namespace in the given SchemaSystem.
 
Method Summary
 void addType(ComplexType type)
          Add a ComplexType to this Schema.
 java.lang.String getNamespace()
          Getter for the namespace of this Schema.
 Particle getParticle(java.lang.String name)
          Get a global particle by its name.
 java.lang.String getPrefixForNamespace(java.lang.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(java.lang.String name)
          Get a Type contained in this schema by name.
 Particle newAttribute(java.lang.String name)
          Create and add a new global attribute for this schema.
 Particle newElement(java.lang.String name)
          Create and add a new root element for this schema.
 void putPrefixForNamespace(java.lang.String prefix, java.lang.String namespace)
          Set the prefix used in this schema for a different namespace.
 void save(com.eviware.soapui.inferredSchema.SchemaConfig xml)
          Save the Schema to an XmlObject.
 java.lang.String toString()
           
 void validate(Context context)
          Validates an XML document contained in a given Context object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Schema

public Schema(java.lang.String namespace,
              SchemaSystem schemaSystem)
Constructs a blank new Schema for the given namespace in the given SchemaSystem.

Parameters:
namespace - The namespace for the new schema.
schemaSystem - The SchemaSystem in which to place the newly created Schema.

Schema

public Schema(com.eviware.soapui.inferredSchema.SchemaConfig xml,
              SchemaSystem schemaSystem)
Constructs a Schema object using previously saved data.

Parameters:
xml - The XmlObject to which data has previously been saved.
schemaSystem - The SchemaSystem in which to place the newly created Schema.
Method Detail

save

public void save(com.eviware.soapui.inferredSchema.SchemaConfig xml)
Save the Schema to an XmlObject.

Parameters:
xml - A blank XmlObject to save to.

addType

public void addType(ComplexType type)
Add a ComplexType to this Schema.

Parameters:
type - The ComplexType to be added.

getNamespace

public java.lang.String getNamespace()
Getter for the namespace of this Schema.

Returns:
The namespace of this Schema.

getPrefixForNamespace

public java.lang.String getPrefixForNamespace(java.lang.String namespace)
Gets the prefix used in this schema for a different namespace, if one exists.

Parameters:
namespace - Another namespace to get the prefix for.
Returns:
The prefix used for the given namespace.

putPrefixForNamespace

public void putPrefixForNamespace(java.lang.String prefix,
                                  java.lang.String namespace)
Set the prefix used in this schema for a different namespace.

Parameters:
prefix - The prefix to be used.
namespace - The namespace to use the prefix for.

getType

public Type getType(java.lang.String name)
Get a Type contained in this schema by name.

Parameters:
name - The name of a contained Type.
Returns:
Returns the Type, if one is found. Otherwise returns null.

newElement

public Particle newElement(java.lang.String name)
Create and add a new root element for this schema.

Parameters:
name - The name to give the newly created element.
Returns:
Returns the newly created element.

newAttribute

public Particle newAttribute(java.lang.String name)
Create and add a new global attribute for this schema.

Parameters:
name - The name to give the newly created attribute.
Returns:
Returns the newly created attribute.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

validate

public void validate(Context context)
              throws org.apache.xmlbeans.XmlException
Validates an XML document contained in a given Context object.

Parameters:
context - A Context object containing the XML data to be validated, and other needed contextual variables.
Throws:
org.apache.xmlbeans.XmlException - On unresolvable validation error.

getSystem

public SchemaSystem getSystem()
Getter for the SchemaSystem that contains this Schema.

Returns:
Returns the parent SchemaSystem.

getParticle

public Particle getParticle(java.lang.String name)
Get a global particle by its name.

Parameters:
name - The name of the particle to get.
Returns:
Returns the Particle if one is found. Otherwise returns null.


Copyright © 2005-2010 eviware.com. All Rights Reserved.