Class SchemaUtil
java.lang.Object
com.espertech.esper.common.internal.event.xml.SchemaUtil
Utility class for querying schema information via Xerces implementation classes.
- Author:
- pablo
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaItem
findPropertyMapping
(SchemaElementComplex def, String property) Finds an apropiate definition for the given property, starting at the * given definition.static SchemaElementComplex
findRootElement
(SchemaModel schema, String namespace, String elementName) Returns the root element for a given schema given a root element name and namespace.static String
Serialize the given node.static EPTypeClass
toReturnType
(SchemaItem item, EventTypeXMLXSDHandler xmlxsdHandler) Returns the Class-type of the schema item.static EPTypeClass
toReturnType
(QName resultType, EPTypeClass optionalCastToType) Returns the native type based on XPathConstants qname and an optional cast-to type, if provided.
-
Field Details
-
TYPE_MAP
-
-
Constructor Details
-
SchemaUtil
public SchemaUtil()
-
-
Method Details
-
toReturnType
Returns the Class-type of the schema item.- Parameters:
item
- to to determine type forxmlxsdHandler
- xml-xsd handler- Returns:
- type
-
toReturnType
Returns the native type based on XPathConstants qname and an optional cast-to type, if provided.- Parameters:
resultType
- qnameoptionalCastToType
- null or cast-to type- Returns:
- return type
-
findRootElement
public static SchemaElementComplex findRootElement(SchemaModel 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 interrogatenamespace
- is the namespace of the root elementelementName
- is the name of the root element- Returns:
- declaration of root element
-
findPropertyMapping
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 simple and then child element definitions.- Parameters:
def
- the definition to start lookingproperty
- the property to look for- Returns:
- schema element or null if not found
-
serialize
Serialize the given node.- Parameters:
doc
- node to serialize- Returns:
- serialized node string
-