net.esper.event.xml
Class SchemaUtil

java.lang.Object
  extended by net.esper.event.xml.SchemaUtil

public class SchemaUtil
extends Object

Utility class for querying schema information via Xerces implementation classes.

Author:
pablo

Constructor Summary
SchemaUtil()
           
 
Method Summary
static com.sun.org.apache.xerces.internal.xs.XSObject findPropertyMapping(com.sun.org.apache.xerces.internal.xs.XSComplexTypeDefinition def, String property)
          Finds an apropiate definition for the given property, starting at the given definition.
static com.sun.org.apache.xerces.internal.xs.XSElementDeclaration findRootElement(com.sun.org.apache.xerces.internal.xs.XSModel schema, String namespace, String elementName)
          Returns the root element for a given schema given a root element name and namespace.
static QName simpleTypeToQName(com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl definition)
          Returns the XPathConstants type for a given Xerces type definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaUtil

public SchemaUtil()
Method Detail

simpleTypeToQName

public static QName simpleTypeToQName(com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl definition)
Returns the XPathConstants type for a given Xerces type definition.

Parameters:
definition -
Returns:
XPathConstants type

findRootElement

public static com.sun.org.apache.xerces.internal.xs.XSElementDeclaration findRootElement(com.sun.org.apache.xerces.internal.xs.XSModel schema,
                                                                                         String namespace,
                                                                                         String elementName)
Returns the root element for a given schema given a root element name and namespace.

Parameters:
schema - is the schema to interrogate
namespace - is the namespace of the root element
elementName - is the name of the root element
Returns:
declaration of root element

findPropertyMapping

public static com.sun.org.apache.xerces.internal.xs.XSObject findPropertyMapping(com.sun.org.apache.xerces.internal.xs.XSComplexTypeDefinition def,
                                                                                 String property)
Finds an apropiate definition for the given property, starting at the given definition. First look if the property es an attribute. If not, look at child element definitions.

Parameters:
def - the definition to start looking
property - the property to look for
Returns:
either an XSAttributeUse if the property is an attribute,XSParticle if is an element, or null if not found in schema