com.candle.roma.kxm
Class KxmMsgCreateOptions

java.lang.Object
  |
  +--com.candle.roma.kxm.KxmMsgCreateOptions
All Implemented Interfaces:
java.lang.Cloneable

public class KxmMsgCreateOptions
extends java.lang.Object
implements java.lang.Cloneable

Represents the message creation options. This object is used to provide options to the KxmMessage.KxmMessage(String format, KxmMsgCreateOptions options) and the KxmMessage.KxmMessage(byte[] data, String format, KxmMsgCreateOptions options) methods.

See Also:
KxmMessage, KxmEncoding

Field Summary
static int ANY
          Message creation option.
See setOptions(int options)
static int DISABLE_NAMESPACES
          Message creation option.
See setOptions(int options)
static int FORMAT_NAME
          Message creation option.
See setOptions(int options)
static int HANDLE_NAMESPACES
          Message creation option.
See setOptions(int options)
static int HEX_XML_FORMAT
          Message creation option.
See setOptions(int options)
static int MDR
          Message creation option.
See setOptions(int options)
static int OLD_TEXT_FORMAT
          Message creation option.
See setOptions(int options)
static int PRESERVE_XML_SPACES
          Message creation option.
See setOptions(int options)
static int SCALAR_AS_ARRAY
          Message creation option.
See setOptions(int options)
static int STANDALONE
          Message creation option.
See setOptions(int options)
 
Constructor Summary
KxmMsgCreateOptions()
          Creates the object with no options set.
KxmMsgCreateOptions(int options)
          Creates the object and sets the specified options.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of the object.
 KxmEncoding getEncoding()
          Returns the encoding that will be used for message data parsing.
 long getHandle()
           
 java.lang.String getNsUri()
          Returns the XML namespace URI that will be associated with the root element of the created message.
 int getOptions()
          Returns the message creation options.
 void setEncoding(KxmEncoding encoding)
          Sets the encoding that will be used for message data parsing.
 void setNsUri(java.lang.String uri)
          Sets the XML namespace URI that will be associated with the root element of the created message.
 void setOptions(int options)
          Sets the message creation options.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STANDALONE

public static final int STANDALONE
Message creation option.
See setOptions(int options)

MDR

public static final int MDR
Message creation option.
See setOptions(int options)

ANY

public static final int ANY
Message creation option.
See setOptions(int options)

FORMAT_NAME

public static final int FORMAT_NAME
Message creation option.
See setOptions(int options)

HANDLE_NAMESPACES

public static final int HANDLE_NAMESPACES
Message creation option.
See setOptions(int options)

OLD_TEXT_FORMAT

public static final int OLD_TEXT_FORMAT
Message creation option.
See setOptions(int options)

PRESERVE_XML_SPACES

public static final int PRESERVE_XML_SPACES
Message creation option.
See setOptions(int options)

DISABLE_NAMESPACES

public static final int DISABLE_NAMESPACES
Message creation option.
See setOptions(int options)

HEX_XML_FORMAT

public static final int HEX_XML_FORMAT
Message creation option.
See setOptions(int options)

SCALAR_AS_ARRAY

public static final int SCALAR_AS_ARRAY
Message creation option.
See setOptions(int options)
Constructor Detail

KxmMsgCreateOptions

public KxmMsgCreateOptions()
Creates the object with no options set.

KxmMsgCreateOptions

public KxmMsgCreateOptions(int options)
Creates the object and sets the specified options.
Parameters:
options - Message creation options.
Method Detail

getOptions

public int getOptions()
Returns the message creation options.

setOptions

public void setOptions(int options)
Sets the message creation options.
Parameters:
options - Message creation options.
One of the following mutually exclusive options must be specified:
  • KxmMsgCreateOptions.MDR
    Create a message based on the MDR format defintion.
  • KxmMsgCreateOptions.STANDALONE
    Create an XML message of an arbitrary format. The Metadata Repository is not used in this case.
  • KxmMsgCreateOptions.ANY
    The same as the KxmMsgCreateOptions.MDR, but if the format definition is not found, then create an XML message of an arbitrary format, the same as the KxmMsgCreateOptions.STANDALONE does.
  • KxmMsgCreateOptions.FORMAT_NAME
    Create a message based on the MDR format defintion. If the format definition is not found, then message creation fails.
A combination of the following optional modifiers may be specified in addition to one of the above options.
  • KxmMsgCreateOptions.PRESERVE_XML_SPACES
    By default, the CASP XML parser strips whitespace characters following or preceeding XML markup (start and stop XML element tags, processing instruction tags, comment tags and CDATA tags). If it is necessary to preserve those whitespace characters, then specify this option.
  • KxmMsgCreateOptions.HANDLE_NAMESPACES
    Enables XML Namespaces handling for the message. Specify this option if you are planning to use the KxmField.declareNs(String fieldName, String prefix, String uri) method or be able to get XML namespace information from message fields.
  • KxmMsgCreateOptions.OLD_TEXT_FORMAT
    Enables handling of the data text representation used in the eBP 3.1 and earlier versions.
  • KxmMsgCreateOptions.DISABLE_NAMESPACES
    Disables XML namespace handling. By default the handling is enabled.
  • KxmMsgCreateOptions.HEX_XML_FORMAT
    By default binary data is stored into XML elements as BASE64 encoded sequence. If this option is specified then binary data is stored as HEX sequence.
  • KxmMsgCreateOptions.SCALAR_AS_ARRAY
    If this option is specified then array operations will work for scalar fields.

getEncoding

public KxmEncoding getEncoding()
Returns the encoding that will be used for message data parsing.

setEncoding

public void setEncoding(KxmEncoding encoding)
Sets the encoding that will be used for message data parsing.
Parameters:
encoding - Message data encoding.

getNsUri

public java.lang.String getNsUri()
Returns the XML namespace URI that will be associated with the root element of the created message.

setNsUri

public void setNsUri(java.lang.String uri)
Sets the XML namespace URI that will be associated with the root element of the created message.
Parameters:
uri - XML namespace URI.

toString

public java.lang.String toString()
Returns a string representation of the object.
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of the object.

getHandle

public long getHandle()