| Modifier and Type | Field and Description |
|---|---|
protected static ObjectMapperWrapper |
_MAPPER |
static java.lang.String |
CDATA_NAME |
protected java.util.ArrayList |
mChildObjects |
protected DefinitionManager |
mDefManager |
protected PersistableDefObject |
mDefObj |
protected java.util.LinkedHashMap<java.lang.String,java.lang.Object> |
mMap |
protected java.lang.String |
mTagName |
protected static java.lang.String[][] |
objectTypeMap |
protected static java.lang.String[][] |
pluralTypeMap |
| Constructor and Description |
|---|
JSONOutputStream(DefinitionManager mgr) |
JSONOutputStream(DefinitionManager mgr,
DefPersistable obj) |
JSONOutputStream(DefinitionManager mgr,
oracle.mds.core.MetadataObject mo) |
JSONOutputStream(DefinitionManager mgr,
PersistableDefObject obj,
boolean bBuffer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addItemString(java.util.ArrayList itemsList,
java.lang.Object obj) |
protected void |
beforeWriteChildren(PersistentDefinition jtpObject) |
void |
commit()
This method Commits the transaction.
|
protected JSONOutputStream |
createChildOutputStream(PersistentDefinition jtpObject) |
protected JSONOutputStream |
createLoadOutputStream() |
protected void |
filterChildObjects() |
protected java.lang.Object |
filterChildObjectsByType(java.lang.String tag) |
protected JSONOutputStream |
findChildOutputStream(PersistentDefinition jtpObject) |
protected JSONOutputStream |
findChildOutputStream(java.lang.String nameTag) |
static java.lang.String |
getJSONFileName(PersistableDefObject obj) |
static java.lang.String |
getJSONObjectType(JsonNodeWrapper jsonNode) |
static java.lang.String |
getJSONObjectType(java.lang.String fileName) |
static java.lang.String |
getJSONObjectType2(java.io.Reader reader) |
java.util.LinkedHashMap<java.lang.String,java.lang.Object> |
getMap() |
static ObjectMapperWrapper |
getObjectMapper() |
protected java.lang.String |
getPluralTagFromXMLTag(java.lang.String xmlTag) |
java.lang.StringBuffer |
getStringBuffer() |
protected void |
guaranteePath(java.lang.String fileName) |
protected void |
initDefObject(PersistableDefObject defObj) |
void |
initDefWriterFromMap(java.util.Map jsonMap) |
protected java.util.ArrayList |
initItemList(java.lang.String attrName,
java.util.ArrayList propList) |
boolean |
isBufferOutput() |
protected boolean |
isDefaultValue(java.lang.String attrName,
java.lang.String value) |
boolean |
isJSON() |
boolean |
isPersistAsChildMap() |
boolean |
isTipCustomizedAttribute(java.lang.String attrName)
Indicates whether the attribute for the current element XML element
was set at the tip CC layer.
|
boolean |
isTipInserted()
Indicates whether the current element XML element was inserted at
the tip CC layer.
|
static java.lang.String |
objectTagToXMLTag(java.lang.String tagName) |
void |
openConnection(java.lang.String tagName) |
void |
openConnection(java.lang.String fileName,
java.lang.String tagName) |
static java.lang.String |
pluralChildNameToXMLTag(java.lang.String parentTag,
java.lang.String pluralName) |
protected void |
postWriteChildren(PersistentDefinition jtpObject) |
void |
removeAttribute(java.lang.String attrName) |
boolean |
removeElementByAttribute(java.lang.String elemName,
java.lang.String attrName,
java.lang.String attrValue) |
boolean |
removeElements(java.lang.String elemName) |
boolean |
removeObject(DefPersistable jtpObject) |
void |
rollback()
This method rolls back the transaction.
|
void |
saveJSONData(DefPersistable obj,
java.lang.String fullFileName) |
void |
saveJSONData(PersistableDefObject obj) |
protected void |
saveJsonFile(java.lang.String fileName,
java.lang.String objJson) |
protected void |
saveName(JSONOutputStream out,
PersistentDefinition jtpObject) |
protected void |
saveName(JSONOutputStream out,
java.lang.String nameTag,
java.lang.String name) |
void |
setPersistAsChildMap(boolean bMap) |
protected java.lang.String |
toJson(java.util.Map input) |
boolean |
write2DStringArray(java.lang.String parentAttr,
java.lang.String firstAttr,
java.lang.String secondAttr,
java.util.List<java.util.List<java.lang.String>> items)
This method creates a 2D hierarchical element structure under the parent element.
|
boolean |
writeBoolean(java.lang.String attrName,
boolean value)
This method writes an attribute of type boolean
|
boolean |
writeByte(java.lang.String attrName,
byte value)
This method writes an attribute of type byte
|
boolean |
writeChar(java.lang.String attrName,
char value)
This method writes an attribute of type char
|
void |
writeComment(java.lang.String comment) |
boolean |
writeDouble(java.lang.String attrName,
double value)
This method writes an attribute of type double
|
boolean |
writeFloat(java.lang.String attrName,
float value)
This method writes an attribute of type float
|
boolean |
writeInt(java.lang.String attrName,
int value)
This method writes an attribute of type int
|
boolean |
writeLong(java.lang.String attrName,
long value)
This method writes an attribute of type long
|
void |
writeObject(DefPersistable jtpObject)
Writes a DefPersistible object
|
void |
writeObject(PersistentDefinition jtpObject)
This method writes a persistable object including its children to the
output stream
|
void |
writeObject(PersistentDefinition jtpObject,
boolean bChildAsMap)
Writes a PersistentDefinition object
|
boolean |
writeObject(java.lang.String attrName,
java.lang.Object value)
This method writes an attribute of type object
|
void |
writeProcessingInstruction(java.lang.String target,
java.lang.String data) |
boolean |
writeShort(java.lang.String attrName,
short value)
This method writes an attribute of type short
|
boolean |
writeString(java.lang.String attrName,
java.lang.String value)
This method writes an attribute of type String
|
boolean |
writeStringArray(java.lang.String attrName,
java.util.Enumeration iter)
This method writes an attribute of type String
|
boolean |
writeStringArray(java.lang.String attrName,
java.util.Iterator iter)
This method writes an attribute of type String
|
boolean |
writeStringArray(java.lang.String attrName,
java.lang.Object[] value)
This method writes an attribute of type String
|
boolean |
writeStringArray2(java.lang.String attrName,
java.util.Enumeration iter) |
boolean |
writeStringArray2(java.lang.String attrName,
java.util.Iterator iter) |
boolean |
writeStringArrayElement(java.lang.String attrName,
java.util.Iterator value)
This method writes an attribute of type String
|
boolean |
writeStringList(java.lang.String attrName,
java.lang.String[] values)
This method writes an attribute of type String
For JSON, this reads a simple list of strings instead
of the more complex xml element structure.
|
boolean |
writeTable(DefPersistable jtpObject,
java.lang.String attrName,
java.util.HashMap value)
This method writes an attribute of type Hashtable
|
boolean |
writeTable(DefPersistable jtpObject,
java.lang.String attrName,
java.util.Hashtable value)
This method writes an attribute of type Hashtable
|
boolean |
writeTable(DefPersistable jtpObject,
java.lang.String attrName,
java.lang.String elemName,
java.lang.String name,
java.lang.String value,
java.util.HashMap ht)
This method writes an attribute of type Hashtable
|
boolean |
writeTable(DefPersistable jtpObject,
java.lang.String attrName,
java.lang.String elemName,
java.lang.String name,
java.lang.String value,
java.util.HashMap ht,
boolean bAsMap)
This method writes an attribute of type Hashtable
|
boolean |
writeTable(DefPersistable jtpObject,
java.lang.String attrName,
java.lang.String elemName,
java.lang.String name,
java.lang.String value,
java.util.Hashtable ht)
This method writes an attribute of type Hashtable
|
void |
writeUserObject(java.lang.String elementName,
java.lang.String value) |
void |
writeUserObject(java.lang.String ns,
java.lang.String elementName,
java.lang.String value) |
org.w3c.dom.Element |
writeUserObjectWithAttrs(java.lang.String ns,
java.lang.String elementName,
java.lang.String value,
java.util.LinkedHashMap map) |
void |
writeUserObjectWithName(java.lang.String elementName,
java.lang.String name,
java.lang.String value) |
boolean |
writeUserString(java.lang.String attrName,
java.lang.String value)
This method writes an attribute of type String
This method replaces the system characters such as '"&<> to
escape sequences that XML parser understands.
|
boolean |
writeUserStringArrayElement(java.lang.String attrName,
java.lang.String elemName,
java.util.Iterator value)
This method writes CData elements of type String
|
boolean |
writeUserStringElementsMap(DefPersistable jtpObject,
java.lang.String attrName,
java.lang.String elemName,
java.util.HashMap values) |
java.lang.Object |
writeVariableValues(java.lang.String elemName,
java.lang.Object[] objs) |
static java.lang.String |
xmlTagToObjectTag(java.lang.String tagName) |
static java.lang.String |
xmlTagToPluralChildName(java.lang.String tagName) |
protected java.util.LinkedHashMap<java.lang.String,java.lang.Object> mMap
protected java.util.ArrayList mChildObjects
protected static ObjectMapperWrapper _MAPPER
protected PersistableDefObject mDefObj
protected java.lang.String mTagName
protected DefinitionManager mDefManager
public static java.lang.String CDATA_NAME
protected static java.lang.String[][] objectTypeMap
protected static java.lang.String[][] pluralTypeMap
public JSONOutputStream(DefinitionManager mgr)
public JSONOutputStream(DefinitionManager mgr, DefPersistable obj)
public JSONOutputStream(DefinitionManager mgr, oracle.mds.core.MetadataObject mo)
public JSONOutputStream(DefinitionManager mgr, PersistableDefObject obj, boolean bBuffer)
public static ObjectMapperWrapper getObjectMapper()
public static java.lang.String xmlTagToPluralChildName(java.lang.String tagName)
public static java.lang.String pluralChildNameToXMLTag(java.lang.String parentTag,
java.lang.String pluralName)
public static java.lang.String xmlTagToObjectTag(java.lang.String tagName)
public static java.lang.String objectTagToXMLTag(java.lang.String tagName)
public void openConnection(java.lang.String tagName)
public void openConnection(java.lang.String fileName,
java.lang.String tagName)
openConnection in interface DefWriterpublic void commit()
public void saveJSONData(PersistableDefObject obj)
public void saveJSONData(DefPersistable obj, java.lang.String fullFileName)
public java.lang.StringBuffer getStringBuffer()
getStringBuffer in interface DefWriterpublic boolean isBufferOutput()
isBufferOutput in interface DefWriterpublic boolean isPersistAsChildMap()
public void setPersistAsChildMap(boolean bMap)
public java.util.LinkedHashMap<java.lang.String,java.lang.Object> getMap()
public static java.lang.String getJSONFileName(PersistableDefObject obj)
protected java.lang.String toJson(java.util.Map input)
protected void saveJsonFile(java.lang.String fileName,
java.lang.String objJson)
protected void guaranteePath(java.lang.String fileName)
public void writeObject(DefPersistable jtpObject)
writeObject in interface DefWriterjtpObject - the DefPersistable object to writepublic void writeObject(PersistentDefinition jtpObject, boolean bChildAsMap)
writeObject in interface DefWriterjtpObject - the DefPersistable object to writebChildAsMap - save the object as a map, not a listpublic void writeObject(PersistentDefinition jtpObject)
DefWriterwriteObject in interface DefWriterjtpObject - the PersistentDefinition object to writeprotected JSONOutputStream createChildOutputStream(PersistentDefinition jtpObject)
protected JSONOutputStream findChildOutputStream(PersistentDefinition jtpObject)
protected JSONOutputStream findChildOutputStream(java.lang.String nameTag)
protected void saveName(JSONOutputStream out, PersistentDefinition jtpObject)
protected void saveName(JSONOutputStream out, java.lang.String nameTag, java.lang.String name)
public boolean writeString(java.lang.String attrName,
java.lang.String value)
writeString in interface DefWriterattrName - the name of the Attribute to readvalue - Value of the Attributeprotected boolean isDefaultValue(java.lang.String attrName,
java.lang.String value)
public boolean writeUserString(java.lang.String attrName,
java.lang.String value)
writeUserString in interface DefWriterattrName - the name of the Attribute to readvalue - Value of the Attributepublic boolean writeInt(java.lang.String attrName,
int value)
public boolean writeShort(java.lang.String attrName,
short value)
writeShort in interface DefWriterattrName - the name of the Attribute to readvalue - Value of the Attributepublic boolean writeLong(java.lang.String attrName,
long value)
public boolean writeFloat(java.lang.String attrName,
float value)
writeFloat in interface DefWriterattrName - the name of the Attribute to readvalue - Value of the Attributepublic boolean writeDouble(java.lang.String attrName,
double value)
writeDouble in interface DefWriterattrName - the name of the Attribute to readvalue - Value of the Attributepublic boolean writeBoolean(java.lang.String attrName,
boolean value)
writeBoolean in interface DefWriterattrName - the name of the Attribute to readvalue - Value of the Attributepublic boolean writeByte(java.lang.String attrName,
byte value)
public boolean writeChar(java.lang.String attrName,
char value)
public boolean writeStringArray(java.lang.String attrName,
java.util.Iterator iter)
writeStringArray in interface DefWriterattrName - the name of the Attribute to readvalue - Enumeration of valuespublic boolean writeStringArray(java.lang.String attrName,
java.util.Enumeration iter)
writeStringArray in interface DefWriterattrName - the name of the Attribute to readvalue - Enumeration of valuespublic boolean writeStringArray2(java.lang.String attrName,
java.util.Iterator iter)
public boolean writeStringArray2(java.lang.String attrName,
java.util.Enumeration iter)
protected java.util.ArrayList initItemList(java.lang.String attrName,
java.util.ArrayList propList)
protected void addItemString(java.util.ArrayList itemsList,
java.lang.Object obj)
public boolean writeStringArray(java.lang.String attrName,
java.lang.Object[] value)
writeStringArray in interface DefWriterattrName - the name of the Attribute to readvalue - Enumeration of valuespublic boolean writeStringList(java.lang.String attrName,
java.lang.String[] values)
writeStringList in interface DefWriterattrName - the name of the Attribute to readen - Array of valuespublic void writeUserObject(java.lang.String ns,
java.lang.String elementName,
java.lang.String value)
writeUserObject in interface DefWriterpublic org.w3c.dom.Element writeUserObjectWithAttrs(java.lang.String ns,
java.lang.String elementName,
java.lang.String value,
java.util.LinkedHashMap map)
throws DefPersistenceException
writeUserObjectWithAttrs in interface DefWriterDefPersistenceExceptionpublic void writeUserObject(java.lang.String elementName,
java.lang.String value)
writeUserObject in interface DefWriterpublic void writeUserObjectWithName(java.lang.String elementName,
java.lang.String name,
java.lang.String value)
public boolean writeObject(java.lang.String attrName,
java.lang.Object value)
writeObject in interface DefWriterattrName - the name of the Attribute to readvalue - Value of the Attributepublic boolean writeTable(DefPersistable jtpObject, java.lang.String attrName, java.util.HashMap value)
writeTable in interface DefWriterjtpObject - the object holding this AttributeattrName - the name of the Attribute to writtenvalue - the value of the Attributepublic boolean writeTable(DefPersistable jtpObject, java.lang.String attrName, java.util.Hashtable value)
writeTable in interface DefWriterjtpObject - the object holding this AttributeattrName - the name of the Attribute to writtenvalue - the value of the Attributepublic boolean writeTable(DefPersistable jtpObject, java.lang.String attrName, java.lang.String elemName, java.lang.String name, java.lang.String value, java.util.Hashtable ht)
DefWriterwriteTable in interface DefWriterjtpObject - the object holding this AttributeattrName - the name of the Attribute to writtenelemName - the value of the name of the attribute.name - the value of the label of the attribute namevalue - the value of the label for the attribute valueht - the value of the Attributepublic boolean writeTable(DefPersistable jtpObject, java.lang.String attrName, java.lang.String elemName, java.lang.String name, java.lang.String value, java.util.HashMap ht)
DefWriterwriteTable in interface DefWriterjtpObject - the object holding this AttributeattrName - the name of the Attribute to writtenelemName - the value of the name of the attribute.name - the value of the label of the attribute namevalue - the value of the label for the attribute valueht - the value of the Attributepublic boolean writeTable(DefPersistable jtpObject, java.lang.String attrName, java.lang.String elemName, java.lang.String name, java.lang.String value, java.util.HashMap ht, boolean bAsMap)
DefWriterwriteTable in interface DefWriterjtpObject - the object holding this AttributeattrName - the name of the Attribute to writtenelemName - the value of the name of the attribute.name - the value of the label of the attribute namevalue - the value of the label for the attribute valueht - the value of the AttributebAsMap - save the object as a map, not a listpublic void rollback()
public boolean isTipInserted()
DefWriterisTipInserted in interface DefWritertrue if this element was inserted at the tip
CC layer. If the persistence backend does not support
customization, it returns true as well.public boolean isTipCustomizedAttribute(java.lang.String attrName)
DefWriterfalse.isTipCustomizedAttribute in interface DefWritertrue if the attribute was set at the tip
CC layer. If the persistence backend does not support
customization, it returns true as well.public boolean writeStringArrayElement(java.lang.String attrName,
java.util.Iterator value)
writeStringArrayElement in interface DefWriterattrName - the name of the element to writevalue - Enumeration of valuespublic boolean writeUserStringArrayElement(java.lang.String attrName,
java.lang.String elemName,
java.util.Iterator value)
writeUserStringArrayElement in interface DefWriterpublic boolean writeUserStringElementsMap(DefPersistable jtpObject, java.lang.String attrName, java.lang.String elemName, java.util.HashMap values)
writeUserStringElementsMap in interface DefWriterpublic void writeProcessingInstruction(java.lang.String target,
java.lang.String data)
writeProcessingInstruction in interface DefWriterpublic boolean write2DStringArray(java.lang.String parentAttr,
java.lang.String firstAttr,
java.lang.String secondAttr,
java.util.List<java.util.List<java.lang.String>> items)
DefWriterwrite2DStringArray in interface DefWriterparentAttr - - Name of the parent element under which this 2D structure is to be builtfirstAttr - - Name of the first level elementsecondAttr - - Name of the second level elementitems - - A list of list of strings which represents the 2D structure to be addedpublic void writeComment(java.lang.String comment)
writeComment in interface DefWriterpublic java.lang.Object writeVariableValues(java.lang.String elemName,
java.lang.Object[] objs)
writeVariableValues in interface DefWriterpublic boolean removeElements(java.lang.String elemName)
removeElements in interface DefWriterpublic boolean removeElementByAttribute(java.lang.String elemName,
java.lang.String attrName,
java.lang.String attrValue)
removeElementByAttribute in interface DefWriterpublic boolean removeObject(DefPersistable jtpObject)
removeObject in interface DefWriterpublic void removeAttribute(java.lang.String attrName)
removeAttribute in interface DefWriterprotected void beforeWriteChildren(PersistentDefinition jtpObject)
protected void postWriteChildren(PersistentDefinition jtpObject)
protected void filterChildObjects()
protected java.lang.String getPluralTagFromXMLTag(java.lang.String xmlTag)
protected java.lang.Object filterChildObjectsByType(java.lang.String tag)
public static java.lang.String getJSONObjectType(java.lang.String fileName)
public static java.lang.String getJSONObjectType2(java.io.Reader reader)
public static java.lang.String getJSONObjectType(JsonNodeWrapper jsonNode)
protected void initDefObject(PersistableDefObject defObj)
public void initDefWriterFromMap(java.util.Map jsonMap)
protected JSONOutputStream createLoadOutputStream()