public class XmiCasDeserializer extends Object
| Modifier and Type | Class and Description | 
|---|---|
| class  | XmiCasDeserializer.XmiCasDeserializerHandler | 
| Constructor and Description | 
|---|
| XmiCasDeserializer(TypeSystem ts) | 
| XmiCasDeserializer(TypeSystem ts,
                  UimaContext uimaContext)Create a new deserializer from a type system. | 
| Modifier and Type | Method and Description | 
|---|---|
| static void | deserialize(InputStream aStream,
           CAS aCAS)Deserializes a CAS from XMI. | 
| static void | deserialize(InputStream aStream,
           CAS aCAS,
           boolean aLenient)Deserializes a CAS from XMI. | 
| static void | deserialize(InputStream aStream,
           CAS aCAS,
           boolean aLenient,
           XmiSerializationSharedData aSharedData)Deserializes a CAS from XMI. | 
| static void | deserialize(InputStream aStream,
           CAS aCAS,
           boolean aLenient,
           XmiSerializationSharedData aSharedData,
           int aMergePoint)Deserializes a CAS from XMI. | 
| static void | deserialize(InputStream aStream,
           CAS aCAS,
           boolean aLenient,
           XmiSerializationSharedData aSharedData,
           int aMergePoint,
           org.apache.uima.cas.impl.AllowPreexistingFS allowPreexistingFS)Deserializes a CAS from XMI. | 
| DefaultHandler | getXmiCasHandler(CAS cas)Create a default handler for deserializing a CAS from XMI. | 
| DefaultHandler | getXmiCasHandler(CAS cas,
                boolean lenient)Create a default handler for deserializing a CAS from XMI. | 
| DefaultHandler | getXmiCasHandler(CAS cas,
                boolean lenient,
                XmiSerializationSharedData sharedData)Create a default handler for deserializing a CAS from XMI. | 
| DefaultHandler | getXmiCasHandler(CAS cas,
                boolean lenient,
                XmiSerializationSharedData sharedData,
                int mergePoint)Create a default handler for deserializing a CAS from XMI. | 
| DefaultHandler | getXmiCasHandler(CAS cas,
                boolean lenient,
                XmiSerializationSharedData sharedData,
                int mergePoint,
                org.apache.uima.cas.impl.AllowPreexistingFS allow)Create a default handler for deserializing a CAS from XMI. | 
public XmiCasDeserializer(TypeSystem ts, UimaContext uimaContext)
 Note: all CAS arguments later supplied to
 getXCASHandler() must have this type system as their type system.
ts - The type system of the CASes to be deserialized.uimaContext - the UIMA Context to use for the deserializationpublic XmiCasDeserializer(TypeSystem ts)
public DefaultHandler getXmiCasHandler(CAS cas)
cas - This CAS will be used to hold the data deserialized from the XMIDefaultHandler to pass to the SAX parser.public DefaultHandler getXmiCasHandler(CAS cas, boolean lenient)
getXmiCasHandler(CAS,boolean) to turn on lenient mode
 and ignore any unknown types.cas - This CAS will be used to hold the data deserialized from the XMIlenient - if true, unknown Types will be ignored. If false, unknown Types will cause an
          exception. The default is false.DefaultHandler to pass to the SAX parser.public DefaultHandler getXmiCasHandler(CAS cas, boolean lenient, XmiSerializationSharedData sharedData)
getXmiCasHandler(CAS,boolean) to turn on lenient mode
 and ignore any unknown types.cas - This CAS will be used to hold the data deserialized from the XMIlenient - if true, unknown Types will be ignored. If false, unknown Types will cause an
          exception. The default is false.sharedData - data structure used to allow the XmiCasSerializer and XmiCasDeserializer to share
          information.DefaultHandler to pass to the SAX parser.public DefaultHandler getXmiCasHandler(CAS cas, boolean lenient, XmiSerializationSharedData sharedData, int mergePoint)
getXmiCasHandler(CAS,boolean) to turn on lenient mode
 and ignore any unknown types.cas - This CAS will be used to hold the data deserialized from the XMIlenient - if true, unknown Types will be ignored. If false, unknown Types will cause an
          exception. The default is false.sharedData - data structure used to allow the XmiCasSerializer and XmiCasDeserializer to share
          information.mergePoint - (represented as an xmiId, not an fsAddr)
          used to support merging multiple XMI CASes. If the mergePoint is negative, "normal"
          deserialization will be done, meaning the target CAS will be reset and the entire XMI
          content will be deserialized. If the mergePoint is nonnegative (including 0), the
          target CAS will not be reset, and only Feature Structures whose xmi:id is strictly
          greater than the mergePoint value will be deserialized.DefaultHandler to pass to the SAX parser.public DefaultHandler getXmiCasHandler(CAS cas, boolean lenient, XmiSerializationSharedData sharedData, int mergePoint, org.apache.uima.cas.impl.AllowPreexistingFS allow)
getXmiCasHandler(CAS,boolean) to turn on lenient mode
 and ignore any unknown types.cas - This CAS will be used to hold the data deserialized from the XMIlenient - if true, unknown Types will be ignored. If false, unknown Types will cause an
          exception. The default is false.sharedData - data structure used to allow the XmiCasSerializer and XmiCasDeserializer to share
          information.mergePoint - used to support merging multiple XMI CASes. If the mergePoint is negative, "normal"
          deserialization will be done, meaning the target CAS will be reset and the entire XMI
          content will be deserialized. If the mergePoint is nonnegative (including 0), the
          target CAS will not be reset, and only Feature Structures whose xmi:id is strictly
          greater than the mergePoint value will be deserialized.allow - indicates what action to do if a pre-existing FS is foundDefaultHandler to pass to the SAX parser.public static void deserialize(InputStream aStream, CAS aCAS) throws SAXException, IOException
aStream - input stream from which to read the XMI documentaCAS - CAS into which to deserialize. This CAS must be set up with a type system that is
          compatible with that in the XMISAXException - if an XML Parsing error occursIOException - if an I/O failure occurspublic static void deserialize(InputStream aStream, CAS aCAS, boolean aLenient) throws SAXException, IOException
aStream - input stream from which to read the XMI documentaCAS - CAS into which to deserialize. This CAS must be set up with a type system that is
          compatible with that in the XMIaLenient - if true, unknown Types will be ignored. If false, unknown Types will cause an
          exception. The default is false.SAXException - if an XML Parsing error occursIOException - if an I/O failure occurspublic static void deserialize(InputStream aStream, CAS aCAS, boolean aLenient, XmiSerializationSharedData aSharedData) throws SAXException, IOException
aStream - input stream from which to read the XMI documentaCAS - CAS into which to deserialize. This CAS must be set up with a type system that is
          compatible with that in the XMIaLenient - if true, unknown Types will be ignored. If false, unknown Types will cause an
          exception. The default is false.aSharedData - an optional container for data that is shared between the XmiCasSerializer and the 
          XmiCasDeserializer.  See the JavaDocs for XmiSerializationSharedData for details.SAXException - if an XML Parsing error occursIOException - if an I/O failure occurspublic static void deserialize(InputStream aStream, CAS aCAS, boolean aLenient, XmiSerializationSharedData aSharedData, int aMergePoint) throws SAXException, IOException
aStream - input stream from which to read the XMI documentaCAS - CAS into which to deserialize. This CAS must be set up with a type system that is
          compatible with that in the XMIaLenient - if true, unknown Types will be ignored. If false, unknown Types will cause an
          exception. The default is false.aSharedData - a container for data that is shared between the XmiCasSerializer and the XmiCasDeserializer.
          See the JavaDocs for XmiSerializationSharedData for details.aMergePoint - used to support merging multiple XMI CASes. If the mergePoint is negative, "normal"
          deserialization will be done, meaning the target CAS will be reset and the entire XMI
          content will be deserialized. If the mergePoint is nonnegative (including 0), the
          target CAS will not be reset, and only Feature Structures whose xmi:id is strictly
          greater than the mergePoint value will be deserialized.SAXException - if an XML Parsing error occursIOException - if an I/O failure occurspublic static void deserialize(InputStream aStream, CAS aCAS, boolean aLenient, XmiSerializationSharedData aSharedData, int aMergePoint, org.apache.uima.cas.impl.AllowPreexistingFS allowPreexistingFS) throws SAXException, IOException
aStream - input stream from which to read the XMI documentaCAS - CAS into which to deserialize. This CAS must be set up with a
            type system that is compatible with that in the XMIaLenient - if true, unknown Types will be ignored. If false, unknown
            Types will cause an exception. The default is false.aSharedData - a container for data that is shared between the
            XmiCasSerializer and the XmiCasDeserializer.
            See the JavaDocs for XmiSerializationSharedData for
            details.aMergePoint - used to support merging multiple XMI CASes. If the mergePoint
            is negative, "normal" deserialization will be done, meaning
            the target CAS will be reset and the entire XMI content will
            be deserialized. If the mergePoint is nonnegative (including
            0), the target CAS will not be reset, and only Feature
            Structures whose xmi:id is strictly greater than the
            mergePoint value will be deserialized.allowPreexistingFS - used when deserializing delta CAS whether to allow, disallow or
            ignore elements representign preexisting FSs or preexisting 
            FSs updates in View element.
            if IGNORE, FSs below the mergePoint are ignored and only new FSs are processed.
            if ALLOW,  FSs below the mergePoint are processed as well as new FSs.
            if DISALLOW FSs below mergePoint will cause serialization to fail. FSs below
               the mergePoint referenced in View element will be flagged as an error condition
               and will not modifiy the CAS being filled and an exception reporting this will
               be thrown at the end of deserialization.SAXException - if an XML Parsing error occursIOException - if an I/O failure occurs
             
 NOTES:
     It is expected that Delta CAS serialization will serialize 
     modified preexisting FSs first so that disallowed preexisting
     FSs are detected at the start and the CAS being filled is
     left untouched.  If disallowed prexisting FS is encountered in
     the View element, the FS is ignored and the deserialization completes
     but throws an exception at the end. 
            
     Possible performance issue with StringListFS. 
     When processing String, StringArrayFS and StringListFS features of a preexisting FS, 
     the string value in the CAS is updated only if it is not equal to the incoming string value.
     Processing of a StringListFS where a new string value has been inserted, all subsequent
     strings in the list will be updated with new strings.Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.