public class IlrXmlDefaultXomMapper extends java.lang.Object implements IlrXmlXomMapper
ilog.rules.xml.IlrXmlObjects.| Constructor and Description |
|---|
IlrXmlDefaultXomMapper()
Creates a default XOM mapper.
|
IlrXmlDefaultXomMapper(boolean flagInnerClass)
Creates a default XOM mapper.
|
IlrXmlDefaultXomMapper(boolean flagInnerClass,
boolean fieldDomainGenerated)
Creates a default XOM mapper.
|
IlrXmlDefaultXomMapper(boolean flagInnerClass,
boolean fieldDomainGenerated,
boolean forbiddenNameDetection)
Creates a default XOM mapper.
|
IlrXmlDefaultXomMapper(java.lang.Class defaultJavaClass)
Creates a default XOM mapper.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addComplexTypeMapping(java.lang.String namespace,
java.lang.String complexType,
java.lang.Class javaClass)
Adds a Java mapping to an XML complex type.
|
void |
addForbiddenName(java.lang.String keyword)
Adds a forbidden keyword.
|
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 XOM static field name related to
an XML enumeration.
|
java.lang.String |
formatFieldName(java.lang.String namespace,
java.lang.String xmlField,
boolean flagIsUnary)
Formats a XOM field name related to
an XML declaration, that is an attribute or an element.
|
protected java.lang.String |
formatJavaIdentifier(java.lang.String str,
boolean upperCase)
Formats a Java identifier from a string.
|
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.
|
boolean |
isInnerClassGenerated()
Indicates if XML local type are mapped
onto inner XOM class.
|
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)
Returns a Java field that will map the XML selected field.
|
java.lang.String |
modifyForbiddenName(java.lang.String forbiddenName)
Finalizes a name of a component by checking,
for example, that is is not a keyword, and potentially
modify it.
|
void |
setXomClassLoader(java.lang.ClassLoader xomClassLoader) |
public IlrXmlDefaultXomMapper()
public IlrXmlDefaultXomMapper(java.lang.Class defaultJavaClass)
defaultJavaClass - The default Java class related to a complex type.public IlrXmlDefaultXomMapper(boolean flagInnerClass)
flagInnerClass - true if the inner class
generation is activated.public IlrXmlDefaultXomMapper(boolean flagInnerClass,
boolean fieldDomainGenerated)
flagInnerClass - true if the inner classfieldDomainGenerated - true if the field's domain are generated
generation is activated.public IlrXmlDefaultXomMapper(boolean flagInnerClass,
boolean fieldDomainGenerated,
boolean forbiddenNameDetection)
flagInnerClass - true if the inner classfieldDomainGenerated - true if the field's domain are generated
generation is activated.public java.lang.ClassLoader getXomClassLoader()
getXomClassLoader in interface IlrXmlXomMapperpublic void setXomClassLoader(java.lang.ClassLoader xomClassLoader)
public void addForbiddenName(java.lang.String keyword)
keyword - The forbidden keyword to be added.public boolean isForbiddenName(java.lang.String name)
isForbiddenName in interface IlrXmlXomMappername - The string to be checked.true if the string is a forbidden keyword.public void addComplexTypeMapping(java.lang.String namespace,
java.lang.String complexType,
java.lang.Class javaClass)
namespace - The complex type namespace (may be null)complexType - The complex type local name,javaClass - The JAva class mapped on the complex type.public java.lang.String formatClassName(java.lang.String namespace,
java.lang.String xmlComplexType,
java.lang.String xmlParentElement)
formatClassName in interface IlrXmlXomMappernamespace - 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).public java.lang.String formatSimpleTypeName(java.lang.String namespace,
java.lang.String xmlSimpleType,
java.lang.String xmlParentDeclaration)
formatSimpleTypeName in interface IlrXmlXomMappernamespace - 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).public java.lang.String formatFieldName(java.lang.String namespace,
java.lang.String xmlField,
boolean flagIsUnary)
formatFieldName in interface IlrXmlXomMappernamespace - The XML declaration namespace (may be null).xmlField - The XML field name (attribute or element).flagIsUnary - Indicates if an element declaration is
unary (minOccurs<=1, maxOccurs<=1).public java.lang.String formatEnumStaticFieldName(java.lang.String enumLiteral)
formatEnumStaticFieldName in interface IlrXmlXomMapperenumLiteral - The XML enumeration literal).public java.lang.String formatAnyFieldName(boolean flagIsUnary)
formatAnyFieldName in interface IlrXmlXomMapperflagIsUnary - Indicates if a declaration
is unary (minOccurs<=1, maxOccurs<=1).public java.lang.String formatContentFieldName()
formatContentFieldName in interface IlrXmlXomMapperpublic final 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.formatNewIdentifier in interface IlrXmlXomMapperidentifier - The seed name.counter - The counter used to generate a new identifier.public 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.mapComplexType in interface IlrXmlXomMappernamespace - The namespace of the complex type (may be null).xmlComplexType - The complex type name (may be null).public java.lang.reflect.Field mapXomField(IlrAttribute xomField, java.lang.Class parentJavaClass)
mapComplexType with the
complex type related tothe XOM field.mapXomField in interface IlrXmlXomMapperxomField - The field to be mapped.parentJavaClass - The Java class mapped to the complex type defining
the origin XML structure of the Xom field.public boolean isInnerClassGenerated()
isInnerClassGenerated in interface IlrXmlXomMapperpublic boolean isFieldDomainGenerated()
isFieldDomainGenerated in interface IlrXmlXomMapperprotected java.lang.String formatJavaIdentifier(java.lang.String str,
boolean upperCase)
Character.isJavaIdentifierPart and
isJavaIdentifierStart methods indicate
if the string characters could compose a Java identifier.
Otherwise, it is dropped and the next character is made uppercase.str - The string to be Java formatted.upperCase - Indicates if the first letter must be uppercase.public java.lang.String modifyForbiddenName(java.lang.String forbiddenName)
forbiddenName - The name to be checked.public IlrXmlDataTypeMapper createDataTypeMapper(IlrObjectModel objectModel)
createDataTypeMapper in interface IlrXmlXomMapperobjectModel - the object model.© Copyright IBM Corp. 1987, 2017