Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.uima.cas.impl
Class XmiCasDeserializer

    java.lang.Object
      org.apache.uima.cas.impl.XmiCasDeserializer

    public class XmiCasDeserializer

extends Object

XMI CAS deserializer. Used to read in a CAS from XML Metadata Interchange (XMI) format.

Constructor Summary
`XmiCasDeserializer(TypeSystem ts)`
`XmiCasDeserializer(TypeSystem ts, UimaContext uimaContext)` Create a new deserializer from a type system.

Method Summary
`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.
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XmiCasDeserializer

    public XmiCasDeserializer(TypeSystem ts,
                              UimaContext uimaContext)

  Create a new deserializer from a type system. Note: all CAS arguments later supplied to `getXCASHandler()` must have this type system as their type system.

  Parameters:
    `ts` - The type system of the CASes to be deserialized.

### XmiCasDeserializer

    public XmiCasDeserializer(TypeSystem ts)

Method Detail

### getXmiCasHandler

    public DefaultHandler getXmiCasHandler(CAS cas)

  Create a default handler for deserializing a CAS from XMI.

  Parameters:
    `cas` - This CAS will be used to hold the data deserialized from the XMI
  Returns:
    The `DefaultHandler` to pass to the SAX parser.

### getXmiCasHandler

    public DefaultHandler getXmiCasHandler(CAS cas,
                                           boolean lenient)

  Create a default handler for deserializing a CAS from XMI. By default this is not lenient, meaning that if the XMI references Types that are not in the Type System, an Exception will be thrown. Use `getXmiCasHandler(CAS,boolean)` to turn on lenient mode and ignore any unknown types.

  Parameters:
    `cas` - This CAS will be used to hold the data deserialized from the XMI
    `lenient` - if true, unknown Types will be ignored. If false, unknown Types will cause an exception. The default is false.
  Returns:
    The `DefaultHandler` to pass to the SAX parser.

### getXmiCasHandler

    public DefaultHandler getXmiCasHandler(CAS cas,
                                           boolean lenient,
                                           XmiSerializationSharedData sharedData)

  Create a default handler for deserializing a CAS from XMI. By default this is not lenient, meaning that if the XMI references Types that are not in the Type System, an Exception will be thrown. Use `getXmiCasHandler(CAS,boolean)` to turn on lenient mode and ignore any unknown types.

  Parameters:
    `cas` - This CAS will be used to hold the data deserialized from the XMI
    `lenient` - 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.
  Returns:
    The `DefaultHandler` to pass to the SAX parser.

### getXmiCasHandler

    public DefaultHandler getXmiCasHandler(CAS cas,
                                           boolean lenient,
                                           XmiSerializationSharedData sharedData,
                                           int mergePoint)

  Create a default handler for deserializing a CAS from XMI. By default this is not lenient, meaning that if the XMI references Types that are not in the Type System, an Exception will be thrown. Use `getXmiCasHandler(CAS,boolean)` to turn on lenient mode and ignore any unknown types.

  Parameters:
    `cas` - This CAS will be used to hold the data deserialized from the XMI
    `lenient` - 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.
  Returns:
    The `DefaultHandler` to pass to the SAX parser.

### deserialize

    public static void deserialize(InputStream aStream,
                                   CAS aCAS)
                            throws SAXException,
                                   IOException

  Deserializes a CAS from XMI.

  Parameters:
    `aStream` - input stream from which to read the XMI document
    `aCAS` - CAS into which to deserialize. This CAS must be set up with a type system that is compatible with that in the XMI
  Throws:
    `SAXException` - if an XML Parsing error occurs
    `IOException` - if an I/O failure occurs

### deserialize

    public static void deserialize(InputStream aStream,
                                   CAS aCAS,
                                   boolean aLenient)
                            throws SAXException,
                                   IOException

  Deserializes a CAS from XMI.

  Parameters:
    `aStream` - input stream from which to read the XCMI document
    `aCAS` - CAS into which to deserialize. This CAS must be set up with a type system that is compatible with that in the XMI
    `aLenient` - if true, unknown Types will be ignored. If false, unknown Types will cause an exception. The default is false.
  Throws:
    `SAXException` - if an XML Parsing error occurs
    `IOException` - if an I/O failure occurs

### deserialize

    public static void deserialize(InputStream aStream,
                                   CAS aCAS,
                                   boolean aLenient,
                                   XmiSerializationSharedData aSharedData)
                            throws SAXException,
                                   IOException

  Deserializes a CAS from XMI.

  Parameters:
    `aStream` - input stream from which to read the XCMI document
    `aCAS` - CAS into which to deserialize. This CAS must be set up with a type system that is compatible with that in the XMI
    `aLenient` - 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.
  Throws:
    `SAXException` - if an XML Parsing error occurs
    `IOException` - if an I/O failure occurs

### deserialize

    public static void deserialize(InputStream aStream,
                                   CAS aCAS,
                                   boolean aLenient,
                                   XmiSerializationSharedData aSharedData,
                                   int aMergePoint)
                            throws SAXException,
                                   IOException

  Deserializes a CAS from XMI. This version of this method supports merging multiple XMI documents into a single CAS.

  Parameters:
    `aStream` - input stream from which to read the XCMI document
    `aCAS` - CAS into which to deserialize. This CAS must be set up with a type system that is compatible with that in the XMI
    `aLenient` - 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.
  Throws:
    `SAXException` - if an XML Parsing error occurs
    `IOException` - if an I/O failure occurs

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 The Apache Software Foundation. All Rights Reserved.