|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.uima.cas.impl.XmiSerializationSharedData
public class XmiSerializationSharedData
A container for data that is shared between the XmiCasSerializer
and the XmiCasDeserializer
.
This has a number of uses:
XmiSerializationSharedData
instance to the deserializer, the deserializer will store information about the incoming xmi:id values. If you then pass
the same XmiSerializationSharedData
object to the serializer when you attempt to serialize the same CAS,
all of the incoming FS will be serialized using the same xmi:id value that they had when they were deserialized.lenient
parameter set to true,
whenever it encounters an XMI element that doesn't correspond to a type in the type system, it will populate the
XmiSerializationSharedData
with information about these elements. If you then pass the same
XmiSerializationSharedData
object to the serializer when you attempt to serialize the same CAS, these
out-of-typesystem FS will be reserialized without loss of inform
ation. References between in-typesystem and out-of-typesystem
FS (in either direction) are maintained as well.XmiSerializationSharedData
, you can call the
getMaxXmiId()
method to get the maximum xmi:id value in the serialized CAS. This feature, along with the consistency of
xmi:id values, allows merging multiple XMI documents into a single CAS. See TODO.
Constructor Summary | |
---|---|
XmiSerializationSharedData()
|
Method Summary | |
---|---|
void |
addNonsharedRefToFSMapping(int nonsharedFSAddr,
int fsAddr)
Add mapping between the address of FS that is the value of a non-shared multi-valued feature of a FeatureStructure. |
void |
addOutOfTypeSystemArrayElement(int addr,
int index,
int xmiId)
Records an out-of-typesystem array element in the XmiSerializationSharedData. |
void |
addOutOfTypeSystemAttribute(int addr,
String featName,
String featVal)
Records an out-of-typesystem attribute that belongs to an in-typesystem FS. |
void |
addOutOfTypeSystemChildElements(int addr,
String featName,
List<String> featVals)
Records out-of-typesystem child elements that belong to an in-typesystem FS. |
void |
addOutOfTypeSystemElement(org.apache.uima.cas.impl.XmiSerializationSharedData.OotsElementData elemData)
Records information about an XMI element that was not an instance of any type in the type system. |
void |
addOutOfTypeSystemViewMember(String sofaXmiId,
String memberXmiId)
Records that an out-of-typesystem XMI element should be a member of the specified view. |
void |
clearIdMap()
Clears the ID mapping information that was populated in previous serializations or deserializations. |
int[] |
getAllFsAddressesInIdMap()
Get all FS Addresses that have been added to the id map. |
int |
getEncompassingFS(int nonsharedFS)
|
int |
getFsAddrForXmiId(int xmiId)
Gets the FS address that corresponds to the given xmi:id, in the most recent serialization or deserialization. |
int |
getMaxXmiId()
Gets the maximum xmi:id that has been generated or read so far. |
int[] |
getNonsharedMulitValuedFSs()
|
List<org.apache.uima.cas.impl.XmiSerializationSharedData.XmiArrayElement> |
getOutOfTypeSystemArrayElements(int addr)
Gets information about out-of-typesystem array elements. |
List<org.apache.uima.cas.impl.XmiSerializationSharedData.OotsElementData> |
getOutOfTypeSystemElements()
Gets a List of OotsElementData objects, each of which describes an
incoming XMI element that did not correspond to a Type in the TypeSystem. |
org.apache.uima.cas.impl.XmiSerializationSharedData.OotsElementData |
getOutOfTypeSystemFeatures(int addr)
Gets information about out-of-typesystem features that belong to an in-typesystem FS. |
List<String> |
getOutOfTypeSystemViewMembers(String sofaXmiId)
Gets a List of xmi:id's (Strings) of all out-of-typesystem XMI elements that are members of the view with the given id. |
String |
toString()
For debugging purposes only. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XmiSerializationSharedData()
Method Detail |
---|
public int getMaxXmiId()
public int getFsAddrForXmiId(int xmiId)
xmiId
- an xmi:id from the most recent XMI CAS that was serialized
or deserialized.
public void clearIdMap()
public void addOutOfTypeSystemElement(org.apache.uima.cas.impl.XmiSerializationSharedData.OotsElementData elemData)
elemData
- information about the out-of-typesystem XMI elementpublic List<org.apache.uima.cas.impl.XmiSerializationSharedData.OotsElementData> getOutOfTypeSystemElements()
OotsElementData
objects, each of which describes an
incoming XMI element that did not correspond to a Type in the TypeSystem.
OotsElementData
objectspublic void addOutOfTypeSystemViewMember(String sofaXmiId, String memberXmiId)
sofaXmiId
- xmi:id of a SofamemberXmiId
- xmi:id of an out-of-typesystem element that should be
a member of the view for the given Sofapublic List<String> getOutOfTypeSystemViewMembers(String sofaXmiId)
sofaXmiId
- xmi:id of a Sofa
public void addOutOfTypeSystemAttribute(int addr, String featName, String featVal)
addr
- CAS address of the FSfeatName
- name of the featurefeatVal
- value of the feature, as a stringpublic void addOutOfTypeSystemChildElements(int addr, String featName, List<String> featVals)
addr
- CAS address of the FSfeatName
- name of the feature (element tag name)featVal
- values of the feature, as a List of stringspublic org.apache.uima.cas.impl.XmiSerializationSharedData.OotsElementData getOutOfTypeSystemFeatures(int addr)
addr
- CAS address of the FS
public int[] getAllFsAddressesInIdMap()
public List<org.apache.uima.cas.impl.XmiSerializationSharedData.XmiArrayElement> getOutOfTypeSystemArrayElements(int addr)
addr
- the CAS address of an FSArray
XmiArrayElement
objects, each of which
holds the index and xmi:id of an array element that is a
reference to an out-of-typesystem FS.public void addOutOfTypeSystemArrayElement(int addr, int index, int xmiId)
addr
- CAS address of FSArrayindex
- index into arrayxmiId
- xmi:id of the out-of-typesystem element that is the value at the given indexpublic void addNonsharedRefToFSMapping(int nonsharedFSAddr, int fsAddr)
nonsharedFSAddr
- - fs address of non-shared multi-valued feature valuefsAddr
- - fs address of encompassing featurestructurepublic int[] getNonsharedMulitValuedFSs()
public int getEncompassingFS(int nonsharedFS)
nonsharedFS
-
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |