|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.connector.maximo.parsing.EntryConverter
public final class EntryConverter
This class consists exclusively of static methods that operate on or return
Entry
objects and DOM elements.
Schema
,
SchemaElement
Constructor Summary | |
---|---|
EntryConverter()
|
Method Summary | |
---|---|
static void |
checkForOverridenUniqueKeys(SchemaElement rootMbo,
Entry newEntry,
Entry oldEntry,
Log logger)
Check if user has tried to change any unique keys |
static void |
copyUniqueKeys(SchemaElement rootMbo,
Entry newEntry,
Entry oldEntry)
Copies the attributes/values that compose the unique key of the specified MBO from oldEntry to newEntry . |
static String |
entryToXml(SchemaElement rootMbo,
SchemaElement selectedMbo,
Entry entry,
boolean errorOnExcedentSize)
Converts an Entry object into XML content. |
static String |
entryToXml(Schema schema,
Entry entry,
boolean errorOnExcedentSize,
boolean checkUniqueKeys)
This method converts a hierarchical Entry object into a valid XML
representation. |
static Entry |
searchCriteriaToEntry(SearchCriteria searchCriteria,
Schema schema,
boolean errorOnExcedentSize)
Converts a SearchCriteria object into XML content. |
static String |
searchCriteriaToXml(SearchCriteria searchCriteria,
SchemaElement rootMbo,
boolean errorOnExcedentSize)
Converts a SearchCriteria object into XML content. |
static void |
setAttributeActions(Entry e)
This method circles trough all attributes (except leafs) of a hierarchical entry and if some of the attributes has operation Add, Modify or Delete the proper Maximo action will be added as XML attribute. |
static Entry |
xmlToEntry(SchemaElement rootMbo,
SchemaElement selectedMbo,
Node xmlElement)
Converts XML content into an Entry object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EntryConverter()
Method Detail |
---|
public static void copyUniqueKeys(SchemaElement rootMbo, Entry newEntry, Entry oldEntry)
oldEntry
to newEntry
.
rootMbo
- MBO specificationnewEntry
- entry targetoldEntry
- entry sourcepublic static void checkForOverridenUniqueKeys(SchemaElement rootMbo, Entry newEntry, Entry oldEntry, Log logger)
rootMbo
- MBO specificationnewEntry
- entry targetoldEntry
- entry sourcelogger
- Log object used to log warningspublic static String entryToXml(SchemaElement rootMbo, SchemaElement selectedMbo, Entry entry, boolean errorOnExcedentSize) throws MxConnSchemaException
Entry
object into XML content.
rootMbo
- root MBO definitionselectedMbo
- schema element that defines the XML contententry
- entry to be convertederrorOnExcedentSize
- indicates the behavior when a field's value exceeds the
maximun length: true
if an exception should be
thrown, or false
if the field's value should be
truncated
String
object
MxConnSchemaException
- if the specified entry does not comply to the schema
definitionpublic static String entryToXml(Schema schema, Entry entry, boolean errorOnExcedentSize, boolean checkUniqueKeys) throws MxConnSchemaException
Entry
object into a valid XML
representation.
schema
- schema of the current object structureentry
- errorOnExcedentSize
- indicates the behavior when a field's value exceeds the
maximun length: true
if an exception should be
thrown, or false
if the field's value should be
truncatedcheckUniqueKeys
- if true
presence of unique keys will be checked
MxConnSchemaException
- if a unique key is not provided
MxConnExcedentSizeException
- if a string field contains value longer than the maximum
allowed value for this fieldpublic static String searchCriteriaToXml(SearchCriteria searchCriteria, SchemaElement rootMbo, boolean errorOnExcedentSize) throws MxConnSchemaException
SearchCriteria
object into XML content.
searchCriteria
- SearchCriteria
to be convertedrootMbo
- schema element that defines the XML content to which the
specified criteria
will be convertederrorOnExcedentSize
- indicates the behavior when a field's value exceeds the
maximun length: true
if an exception should be
thrown, or false
if the field's value should be
truncated
String
object
MxConnSchemaException
- if
criteria.getType() != SearchCriteria.SEARCH_AND
MxConnSchemaException
- if criteria has any SearchCriteria.rscSearch with
the match attribute different than
SearchCriteria.EXACT and
SearchCriteria.NOT_STRINGpublic static Entry searchCriteriaToEntry(SearchCriteria searchCriteria, Schema schema, boolean errorOnExcedentSize) throws MxConnSchemaException
SearchCriteria
object into XML content.
searchCriteria
- SearchCriteria
to be convertedschema
- schema of the current Object structureerrorOnExcedentSize
- indicates the behavior when a field's value exceeds the
maximun length: true
if an exception should be
thrown, or false
if the field's value should be
truncated
MxConnSchemaException
- if criteria type is different than AND
public static Entry xmlToEntry(SchemaElement rootMbo, SchemaElement selectedMbo, Node xmlElement) throws MxConnSchemaException
Entry
object.
rootMbo
- root MBO definitionselectedMbo
- schema element that defines the XML contentxmlElement
- XML element to be converted
Entry
object converted from XML content
MxConnSchemaException
- if the specified XML content does not comply to the schema
definitionpublic static void setAttributeActions(Entry e)
e
- Entry object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |