public interface IlrXmlXomMapper
The interface is composed of a set of methods describing
how XML symbols are mapped into Java identifiers.
The mapComplexType method defines on which Java class
a complex type is mapped. This class must inherit from
ilog.rules.xml.IlrXmlObject.
The XML-XOM name mapping follows two steps.
formatNewIdentifier
is called with the seed name as a parameter. A counter is incremented until
an identifier is found.IlrXmlHelper,
IlrXmlDefaultXomMapper| Modifier and Type | Method and Description |
|---|---|
IlrXmlDataTypeMapper |
createDataTypeMapper(IlrObjectModel objectModel)
Creates a data type mapper.
|
java.lang.String |
formatAnyFieldName(boolean flagIsUnary)
Formats a XOM field name related to
any XML any particle declaration.
|
java.lang.String |
formatClassName(java.lang.String namespace,
java.lang.String xmlComplexType,
java.lang.String xmlParentElement)
Formats a XOM dynamic class name related to
an XML complex type name.
|
java.lang.String |
formatContentFieldName()
Formats a XOM field name related to
the content of an XML complex type definition.
|
java.lang.String |
formatEnumStaticFieldName(java.lang.String enumLiteral)
Formats a static field name from the
XML enumeration literal.
|
java.lang.String |
formatFieldName(java.lang.String namespace,
java.lang.String xmlDeclaration,
boolean flagIsUnary)
Formats a XOM field name related to
an XML declaration, that is an attribute or an element.
|
java.lang.String |
formatNewIdentifier(java.lang.String identifier,
int counter)
Formats a new unique XOM identifier given a seed identifier
and a counter incremented at each attempt.
|
java.lang.String |
formatSimpleTypeName(java.lang.String namespace,
java.lang.String xmlSimpleType,
java.lang.String xmlParentDeclaration)
Formats a XOM dynamic simple type name related to
an XML simple type identifier.
|
java.lang.ClassLoader |
getXomClassLoader()
Returns the class loader used by the XOM to
resolve inclusion and resource files.
|
boolean |
isFieldDomainGenerated()
Indicates if fiel domain are generated
onto inner XOM classes.
|
boolean |
isForbiddenName(java.lang.String name)
Determines if a string might be considered as a forbidden
name used in IRL or JOM language for example.
|
boolean |
isInnerClassGenerated()
Indicates if XML local types are mapped
onto inner XOM classes.
|
java.lang.Class |
mapComplexType(java.lang.String namespace,
java.lang.String xmlComplexType)
Returns the Java class mapped on an XML complex type.
|
java.lang.reflect.Field |
mapXomField(IlrAttribute xomField,
java.lang.Class parentJavaClass)
Return a Java field that will map the XML selected field.
|
java.lang.String formatClassName(java.lang.String namespace,
java.lang.String xmlComplexType,
java.lang.String xmlParentElement)
namespace - The XML type namespace (may be null).xmlComplexType - The XML complex type name (may be null).xmlParentElement - The name of the element in which the type
is declared (may be null in case of root type definition).java.lang.String formatSimpleTypeName(java.lang.String namespace,
java.lang.String xmlSimpleType,
java.lang.String xmlParentDeclaration)
namespace - The XML type namespace (may be null).xmlSimpleType - The XML simple type name (may be null).xmlParentDeclaration - The name of the declaration
(XML attribute, XML element or content ) in which the type
is declared (may be null).java.lang.String formatFieldName(java.lang.String namespace,
java.lang.String xmlDeclaration,
boolean flagIsUnary)
namespace - The XML declaration namespace (may be null).xmlDeclaration - The XML declaration name (attribute or element).flagIsUnary - Indicates if an element declaration is
unary (minOccurs<=1, maxOccurs<=1).java.lang.String formatEnumStaticFieldName(java.lang.String enumLiteral)
enumLiteral - The enumeration literal.null.java.lang.String formatAnyFieldName(boolean flagIsUnary)
flagIsUnary - Indicates if a declaration
is unary (minOccurs<=1, maxOccurs<=1).java.lang.String formatContentFieldName()
java.lang.String formatNewIdentifier(java.lang.String identifier,
int counter)
myIdentifier_1").
The result should be different for different
values of the counter. If not, it may induce a dead-loop during the
processing of the mapping.identifier - The seed name.counter - The counter used to generate a new identifier.java.lang.Class mapComplexType(java.lang.String namespace,
java.lang.String xmlComplexType)
ilog.rules.xml.IlrXmlObject,
be public and declare a public void constructor. If not,
a runtime exception may be raised.namespace - The namespace of the complex type (may be null).xmlComplexType - The complex type name (may be null).java.lang.reflect.Field mapXomField(IlrAttribute xomField, java.lang.Class parentJavaClass)
mapComplexType with the
complex type related tothe XOM field.xomField - The field to be mapped.parentJavaClass - The Java class mapped to the complex type defining
the origin XML structure of the Xom field.boolean isInnerClassGenerated()
boolean isFieldDomainGenerated()
boolean isForbiddenName(java.lang.String name)
name - The string to be checked.true if the string is a forbidden keywordjava.lang.ClassLoader getXomClassLoader()
IlrXmlDataTypeMapper createDataTypeMapper(IlrObjectModel objectModel)
objectModel - The object model.© Copyright IBM Corp. 1987, 2017