org.fudgemsg.xml
Class FudgeXMLSettings

java.lang.Object
  extended by org.fudgemsg.xml.FudgeXMLSettings
Direct Known Subclasses:
FudgeXMLStreamWriter

public class FudgeXMLSettings
extends Object

Base class to hold common data for the Fudge XML reader and writer as defined by the specification that can be customized for a specific XML source or destination. The default settings are based on XML Fudge Message specification.


Nested Class Summary
protected static class FudgeXMLSettings.XMLEnvelopeAttribute
          Attributes available for the envelope element.
protected static class FudgeXMLSettings.XMLFieldAttribute
          Attributes available for a field element.
 
Field Summary
static String ALIAS_BOOLEAN_FALSE_0
          Alternative value (not written but recognized by default) for a false boolean field.
static String ALIAS_BOOLEAN_FALSE_F
          Alternative value (not written but recognized by default) for a false boolean field.
static String ALIAS_BOOLEAN_FALSE_OFF
          Alternative value (not written but recognized by default) for a false boolean field.
static String ALIAS_BOOLEAN_TRUE_1
          Alternative value (not written but recognized by default) for a true boolean field.
static String ALIAS_BOOLEAN_TRUE_ON
          Alternative value (not written but recognized by default) for a true boolean field.
static String ALIAS_BOOLEAN_TRUE_T
          Alternative value (not written but recognized by default) for a true boolean field.
static String ALIAS_FIELD_ATTRIBUTE_ORDINAL_INDEX
          Alternative attribute name (not written but recognized by default) for the ordinal index of a field.
static String ALIAS_FIELD_ATTRIBUTE_ORDINAL_KEY
          Alternative attribute name (not written but recognized by default) for the ordinal index of a field.
static String DEFAULT_BOOLEAN_FALSE
          Default value for a false boolean field.
static String DEFAULT_BOOLEAN_TRUE
          Default value for a true boolean field.
static String DEFAULT_ENCODING_BASE64
          Default value for base-64 encoded data.
static String DEFAULT_ENVELOPE_ATTRIBUTE_PROCESSINGDIRECTIVES
          Default attribute name for the processing directives on the envelope.
static String DEFAULT_ENVELOPE_ATTRIBUTE_SCHEMAVERSION
          Default attribute name for the schema version on the envelope.
static String DEFAULT_ENVELOPE_ATTRIBUTE_TAXONOMY
          Default attribute name for the taxonomy on the envelope.
static String DEFAULT_ENVELOPE_ELEMENT
          Default element name for the outer envelope tag.
static String DEFAULT_FIELD_ATTRIBUTE_ENCODING
          Default attribute name for the encoding of a field.
static String DEFAULT_FIELD_ATTRIBUTE_NAME
          Default attribute name for the name of a field.
static String DEFAULT_FIELD_ATTRIBUTE_ORDINAL
          Default attribute name for the ordinal index of a field.
static String DEFAULT_FIELD_ATTRIBUTE_TYPE
          Default attribute name for the type of a field.
static String DEFAULT_FIELD_ELEMENT
          Default element name for an anonymous or unnamed field.
 
Constructor Summary
FudgeXMLSettings()
          Creates a new settings object with all of the defaults.
FudgeXMLSettings(FudgeXMLSettings other)
          Creates a new settings object as a copy of another.
 
Method Summary
 void addBase64EncodingAlias(String value)
          Adds an additional alias to recognize as a Base-64 encoding when reading XML input.
protected  void addBooleanAlias(boolean value, String alias)
           
 void addBooleanFalseAlias(String falseValue)
          Adds an additional alias to recognize as a boolean false value when decoding XML input.
 void addBooleanTrueAlias(String trueValue)
          Adds an additional alias to recognize as a boolean true when decoding XML input.
protected  void addEnvelopeAttributeAlias(FudgeXMLSettings.XMLEnvelopeAttribute attribute, String attributeName)
           
 void addEnvelopeAttributeProcessingDirectivesAlias(String processingDirectivesAttributeName)
          Adds an additional alias to recognize as a processing directives attribute in an envelope element.
 void addEnvelopeAttributeSchemaVersionAlias(String schemaVersionAttributeName)
          Adds an additional alias to recognize as a schema version attribute in an envelope element.
 void addEnvelopeAttributeTaxonomyAlias(String taxonomyAttributeName)
          Adds an additional alias to recognize as a taxonomy attribute in an envelope element.
 void addEnvelopeElementAlias(String envelopeElementName)
          Adds an additional alias to recognize as an envelope element when parsing XML input.
protected  void addFieldAttributeAlias(FudgeXMLSettings.XMLFieldAttribute attribute, String attributeName)
           
 void addFieldAttributeEncodingAlias(String encodingAttributeName)
          Adds an additional alias to recognize as an encoding attribute when parsing XML input.
 void addFieldAttributeNameAlias(String nameAttributeName)
          Adds an additional alias to recognize as a field name attribute of a field element when parsing XML input.
 void addFieldAttributeOrdinalAlias(String ordinalAttributeName)
          Adds an additional alias to recognize as a field ordinal attribute when parsing XML input.
 void addFieldAttributeTypeAlias(String typeAttributeName)
          Adds an additional alias to recognize as a field type attribute when parsing XML input.
 void addFieldElementAlias(String fieldElementName)
          Adds an additional alias to recognize as an unnamed field element when parsing XML input.
protected  void clearBooleanAliases(Boolean value)
           
 void clearBooleanFalseAliases()
          Removes any aliases registered with addBooleanFalseAlias(java.lang.String).
 void clearBooleanTrueAliases()
          Removes any aliases registered with addBooleanTrueAlias(java.lang.String).
protected  void clearEnvelopeAttributeAliases(FudgeXMLSettings.XMLEnvelopeAttribute attribute)
           
 void clearEnvelopeAttributeProcessingDirectivesAliases()
          Clears the set of aliases recognized for the processing directives attribute in an envelope element.
 void clearEnvelopeAttributeSchemaVersionAliases()
          Clears the set of aliases recognized for the schema version attribute in an envelope element.
 void clearEnvelopeAttributeTaxonomyAliases()
          Clears the set of aliases recognized for the taxonomy attribute in an envelope element.
 void clearEnvelopeElementAliases()
          Removes any aliases added by addEnvelopeElementAlias(java.lang.String).
protected  void clearFieldAttributeAliases(FudgeXMLSettings.XMLFieldAttribute attribute)
           
 void clearFieldAttributeEncodingAliases()
          Clears the aliases for field encoding attributes set by addFieldAttributeEncodingAlias(java.lang.String).
 void clearFieldAttributeNameAliases()
          Clears the aliases for field name attributes set by addFieldAttributeNameAlias(java.lang.String).
 void clearFieldAttributeOrdinalAliases()
          Clears the aliases for field ordinal attributes set by addFieldAttributeOrdinalAlias(java.lang.String).
 void clearFieldAttributeTypeAliases()
          Clears the aliases for field type attributes set by addFieldAttributeTypeAlias(java.lang.String).
 void clearFieldElementAliases()
          Removes any aliases added by addFieldElementAlias(java.lang.String).
 String fudgeTypeIdToString(int type)
          Returns a type string for a Fudge type identifier.
 boolean getAppendFieldOrdinal()
          Returns true if the field ordinal should be appended to the field name when generating field elements.
protected  Set<String> getBase64EncodingAliases()
           
 String getBase64EncodingName()
          Returns the value to use, or expect, on an encoding attribute if the field data is written in Base-64.
 boolean getBase64UnknownTypes()
          Returns true if the data for unknown types should be encoded in Base-64.
 String getBooleanFalse()
          Returns the value to use for encoding a boolean false value, or to expect when decoding XML input.
 String getBooleanTrue()
          Returns the value to use for encoding a boolean true value, or to expect when decoding XML input.
protected  String getEnvelopeAttribute(FudgeXMLSettings.XMLEnvelopeAttribute attribute)
           
 String getEnvelopeAttributeProcessingDirectives()
          Returns the name to use for the processing directives attribute in an envelope element.
 String getEnvelopeAttributeSchemaVersion()
          Returns the name to use for the schema version attribute in an envelope element.
protected  Map<FudgeXMLSettings.XMLEnvelopeAttribute,String> getEnvelopeAttributesToName()
           
 String getEnvelopeAttributeTaxonomy()
          Returns the name to use for the taxonomy attribute in an envelope element.
protected  Set<String> getEnvelopeElementAliases()
           
 String getEnvelopeElementName()
          Returns the main name for the envelope element.
protected  String getFieldAttribute(FudgeXMLSettings.XMLFieldAttribute attribute)
           
 String getFieldAttributeEncoding()
          Returns the name of the encoding attribute of a field element.
 String getFieldAttributeName()
          Returns the name of the field name attribute in a field element.
 String getFieldAttributeOrdinal()
          Returns the name of the field ordinal attribute in a field element.
protected  Map<FudgeXMLSettings.XMLFieldAttribute,String> getFieldAttributesToName()
           
 String getFieldAttributeType()
          Returns the name of the type attribute in a field element.
protected  Set<String> getFieldElementAliases()
           
 String getFieldElementName()
          Returns the element name to use for unnamed fields.
protected  Map<Integer,String> getFudgeTypesToIdentifier()
           
protected  Map<String,Integer> getIdentifiersToFudgeType()
           
protected  Map<String,FudgeXMLSettings.XMLEnvelopeAttribute> getNamesToEnvelopeAttribute()
           
protected  Map<String,FudgeXMLSettings.XMLFieldAttribute> getNamesToFieldAttribute()
           
 boolean getPreserveFieldNames()
          Returns whether to map the field name to/from the element name.
protected  Map<String,Boolean> getStringsToBoolean()
           
protected  void registerFudgeType(int type, String... identifiers)
           
 void setAppendFieldOrdinal(boolean appendFieldOrdinal)
          Sets whether to append the field ordinal to the default field name when generating field elements.
 void setBase64EncodingName(String value)
          Sets the value to use, or expect, on an encoding attribute if the field data is written in Base-64.
 void setBase64UnknownTypes(boolean base64UnknownTypes)
          Sets whether to encode unknown types in Base-64.
 void setBooleanFalse(String falseValue)
          Sets the value to use for encoding a boolean false value, or to expect when decoding XML input.
 void setBooleanTrue(String trueValue)
          Sets the value to use for encoding a boolean true value, or to expect when decoding XML input.
protected  void setEnvelopeAttribute(FudgeXMLSettings.XMLEnvelopeAttribute attribute, String attributeName)
           
 void setEnvelopeAttributeProcessingDirectives(String processingDirectivesAttributeName)
          Sets the attribute name to use for processing directives in the envelope element.
 void setEnvelopeAttributeSchemaVersion(String schemaVersionAttributeName)
          Sets the attribute name to use for the schema version in the envelope element.
 void setEnvelopeAttributeTaxonomy(String taxonomyAttributeName)
          Sets the attribute name to use for the taxonomy in the envelope element.
 void setEnvelopeElementName(String envelopeElementName)
          Sets the name of the envelope element.
protected  void setFieldAttribute(FudgeXMLSettings.XMLFieldAttribute attribute, String attributeName)
           
 void setFieldAttributeEncoding(String encodingAttributeName)
          Sets the name of the encoding attribute on a field element.
 void setFieldAttributeName(String nameAttributeName)
          Sets the name of the field name attribute on a field element.
 void setFieldAttributeOrdinal(String ordinalAttributeName)
          Sets the name of the field ordinal index attribute on a field element.
 void setFieldAttributeType(String typeAttributeName)
          Sets the name of the type attribute on a field element.
 void setFieldElementName(String fieldElementName)
          Sets the name of the field element for unnamed fields.
 void setPreserveFieldNames(boolean preserveFieldNames)
          Set to use the field name as the element name when writing fields, or derive the field name from the element name when reading.
 Integer stringToFudgeTypeId(String str)
          Returns a Fudge type identifier for a given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ENVELOPE_ELEMENT

public static final String DEFAULT_ENVELOPE_ELEMENT
Default element name for the outer envelope tag.

See Also:
Constant Field Values

DEFAULT_ENVELOPE_ATTRIBUTE_PROCESSINGDIRECTIVES

public static final String DEFAULT_ENVELOPE_ATTRIBUTE_PROCESSINGDIRECTIVES
Default attribute name for the processing directives on the envelope.

See Also:
Constant Field Values

DEFAULT_ENVELOPE_ATTRIBUTE_SCHEMAVERSION

public static final String DEFAULT_ENVELOPE_ATTRIBUTE_SCHEMAVERSION
Default attribute name for the schema version on the envelope.

See Also:
Constant Field Values

DEFAULT_ENVELOPE_ATTRIBUTE_TAXONOMY

public static final String DEFAULT_ENVELOPE_ATTRIBUTE_TAXONOMY
Default attribute name for the taxonomy on the envelope.

See Also:
Constant Field Values

DEFAULT_FIELD_ELEMENT

public static final String DEFAULT_FIELD_ELEMENT
Default element name for an anonymous or unnamed field.

See Also:
Constant Field Values

DEFAULT_FIELD_ATTRIBUTE_NAME

public static final String DEFAULT_FIELD_ATTRIBUTE_NAME
Default attribute name for the name of a field.

See Also:
Constant Field Values

DEFAULT_FIELD_ATTRIBUTE_ORDINAL

public static final String DEFAULT_FIELD_ATTRIBUTE_ORDINAL
Default attribute name for the ordinal index of a field.

See Also:
Constant Field Values

ALIAS_FIELD_ATTRIBUTE_ORDINAL_INDEX

public static final String ALIAS_FIELD_ATTRIBUTE_ORDINAL_INDEX
Alternative attribute name (not written but recognized by default) for the ordinal index of a field.

See Also:
Constant Field Values

ALIAS_FIELD_ATTRIBUTE_ORDINAL_KEY

public static final String ALIAS_FIELD_ATTRIBUTE_ORDINAL_KEY
Alternative attribute name (not written but recognized by default) for the ordinal index of a field.

See Also:
Constant Field Values

DEFAULT_FIELD_ATTRIBUTE_TYPE

public static final String DEFAULT_FIELD_ATTRIBUTE_TYPE
Default attribute name for the type of a field.

See Also:
Constant Field Values

DEFAULT_FIELD_ATTRIBUTE_ENCODING

public static final String DEFAULT_FIELD_ATTRIBUTE_ENCODING
Default attribute name for the encoding of a field.

See Also:
Constant Field Values

DEFAULT_BOOLEAN_TRUE

public static final String DEFAULT_BOOLEAN_TRUE
Default value for a true boolean field.

See Also:
Constant Field Values

ALIAS_BOOLEAN_TRUE_ON

public static final String ALIAS_BOOLEAN_TRUE_ON
Alternative value (not written but recognized by default) for a true boolean field.

See Also:
Constant Field Values

ALIAS_BOOLEAN_TRUE_T

public static final String ALIAS_BOOLEAN_TRUE_T
Alternative value (not written but recognized by default) for a true boolean field.

See Also:
Constant Field Values

ALIAS_BOOLEAN_TRUE_1

public static final String ALIAS_BOOLEAN_TRUE_1
Alternative value (not written but recognized by default) for a true boolean field.

See Also:
Constant Field Values

DEFAULT_BOOLEAN_FALSE

public static final String DEFAULT_BOOLEAN_FALSE
Default value for a false boolean field.

See Also:
Constant Field Values

ALIAS_BOOLEAN_FALSE_OFF

public static final String ALIAS_BOOLEAN_FALSE_OFF
Alternative value (not written but recognized by default) for a false boolean field.

See Also:
Constant Field Values

ALIAS_BOOLEAN_FALSE_F

public static final String ALIAS_BOOLEAN_FALSE_F
Alternative value (not written but recognized by default) for a false boolean field.

See Also:
Constant Field Values

ALIAS_BOOLEAN_FALSE_0

public static final String ALIAS_BOOLEAN_FALSE_0
Alternative value (not written but recognized by default) for a false boolean field.

See Also:
Constant Field Values

DEFAULT_ENCODING_BASE64

public static final String DEFAULT_ENCODING_BASE64
Default value for base-64 encoded data.

See Also:
Constant Field Values
Constructor Detail

FudgeXMLSettings

public FudgeXMLSettings()
Creates a new settings object with all of the defaults.


FudgeXMLSettings

public FudgeXMLSettings(FudgeXMLSettings other)
Creates a new settings object as a copy of another. After copying, changes can be made to the new instance without affecting the other.

Parameters:
other - an existing settings object to copy
Method Detail

getEnvelopeElementAliases

protected Set<String> getEnvelopeElementAliases()
Returns:
the envelopeElementAliases

getFieldElementAliases

protected Set<String> getFieldElementAliases()
Returns:
the fieldElementAliases

getNamesToEnvelopeAttribute

protected Map<String,FudgeXMLSettings.XMLEnvelopeAttribute> getNamesToEnvelopeAttribute()
Returns:
the namesToEnvelopeAttribute

getEnvelopeAttributesToName

protected Map<FudgeXMLSettings.XMLEnvelopeAttribute,String> getEnvelopeAttributesToName()
Returns:
the envelopeAttributesToName

getNamesToFieldAttribute

protected Map<String,FudgeXMLSettings.XMLFieldAttribute> getNamesToFieldAttribute()
Returns:
the namesToFieldAttribute

getFieldAttributesToName

protected Map<FudgeXMLSettings.XMLFieldAttribute,String> getFieldAttributesToName()
Returns:
the fieldAttributesToName

setEnvelopeElementName

public void setEnvelopeElementName(String envelopeElementName)
Sets the name of the envelope element. Other names (aliases) may be recognized when parsing, but this value will always be used when writing. Set to null to disable reading/writing of an envelope element.

Parameters:
envelopeElementName - the name of the element

getEnvelopeElementName

public String getEnvelopeElementName()
Returns the main name for the envelope element. Other names (aliases) may be be recognized when parsing, this value will always be used when writing. Returns null if an envelope element should not be written or expected in the source XML.

Returns:
the name of the element

addEnvelopeElementAlias

public void addEnvelopeElementAlias(String envelopeElementName)
Adds an additional alias to recognize as an envelope element when parsing XML input.

Parameters:
envelopeElementName - the name of the element

clearEnvelopeElementAliases

public void clearEnvelopeElementAliases()
Removes any aliases added by addEnvelopeElementAlias(java.lang.String). Only the main element name as returned by getEnvelopeElementName() will be recognized when parsing XML input.


setFieldElementName

public void setFieldElementName(String fieldElementName)
Sets the name of the field element for unnamed fields. Other names (aliases) may be recognized when parsing, but this value will always be used when writing. Set to null to omit unnamed fields from the XML output, or to treat all field names literally when parsing XML input.

Parameters:
fieldElementName - the name of the element

getFieldElementName

public String getFieldElementName()
Returns the element name to use for unnamed fields. Returns null if unnamed fields shouldn't be written, or not processed when parsing XML input.

Returns:
the name of the element

addFieldElementAlias

public void addFieldElementAlias(String fieldElementName)
Adds an additional alias to recognize as an unnamed field element when parsing XML input.

Parameters:
fieldElementName - the name of the element

clearFieldElementAliases

public void clearFieldElementAliases()
Removes any aliases added by addFieldElementAlias(java.lang.String). Only the main element name as returned by getFieldElementName() will be recognized when parsing XML input.


setEnvelopeAttributeProcessingDirectives

public void setEnvelopeAttributeProcessingDirectives(String processingDirectivesAttributeName)
Sets the attribute name to use for processing directives in the envelope element. Set to null to omit processing directives when writing XML, or ignore in XML input.

Parameters:
processingDirectivesAttributeName - name of the attribute

setEnvelopeAttributeSchemaVersion

public void setEnvelopeAttributeSchemaVersion(String schemaVersionAttributeName)
Sets the attribute name to use for the schema version in the envelope element. Set to null to omit schema version when writing XML, or ignore in XML input.

Parameters:
schemaVersionAttributeName - name of the attribute

setEnvelopeAttributeTaxonomy

public void setEnvelopeAttributeTaxonomy(String taxonomyAttributeName)
Sets the attribute name to use for the taxonomy in the envelope element. Set to null to omit taxonomy information when writing XML, or ignore in XML input.

Parameters:
taxonomyAttributeName - name of the attribute

setEnvelopeAttribute

protected void setEnvelopeAttribute(FudgeXMLSettings.XMLEnvelopeAttribute attribute,
                                    String attributeName)
Parameters:
attribute -
attributeName -

getEnvelopeAttributeProcessingDirectives

public String getEnvelopeAttributeProcessingDirectives()
Returns the name to use for the processing directives attribute in an envelope element. Returns null if processing directives should be omitted from output, or ignored in XML input.

Returns:
the name of the attribute

getEnvelopeAttributeSchemaVersion

public String getEnvelopeAttributeSchemaVersion()
Returns the name to use for the schema version attribute in an envelope element. Returns null if schema version should be omitted from output, or ignored in XML input.

Returns:
the name of the attribute

getEnvelopeAttributeTaxonomy

public String getEnvelopeAttributeTaxonomy()
Returns the name to use for the taxonomy attribute in an envelope element. Returns null if taxonomy should be omitted from output, or ignored in XML input.

Returns:
the name of the attribute

getEnvelopeAttribute

protected String getEnvelopeAttribute(FudgeXMLSettings.XMLEnvelopeAttribute attribute)
Parameters:
attribute -
Returns:

addEnvelopeAttributeProcessingDirectivesAlias

public void addEnvelopeAttributeProcessingDirectivesAlias(String processingDirectivesAttributeName)
Adds an additional alias to recognize as a processing directives attribute in an envelope element.

Parameters:
processingDirectivesAttributeName - the name of the attribute

addEnvelopeAttributeSchemaVersionAlias

public void addEnvelopeAttributeSchemaVersionAlias(String schemaVersionAttributeName)
Adds an additional alias to recognize as a schema version attribute in an envelope element.

Parameters:
schemaVersionAttributeName - the name of the attribute

addEnvelopeAttributeTaxonomyAlias

public void addEnvelopeAttributeTaxonomyAlias(String taxonomyAttributeName)
Adds an additional alias to recognize as a taxonomy attribute in an envelope element.

Parameters:
taxonomyAttributeName - the name of the attribute

addEnvelopeAttributeAlias

protected void addEnvelopeAttributeAlias(FudgeXMLSettings.XMLEnvelopeAttribute attribute,
                                         String attributeName)
Parameters:
attribute -
attributeName -

clearEnvelopeAttributeProcessingDirectivesAliases

public void clearEnvelopeAttributeProcessingDirectivesAliases()
Clears the set of aliases recognized for the processing directives attribute in an envelope element. Only the main attribute name is recognized afterwards.


clearEnvelopeAttributeSchemaVersionAliases

public void clearEnvelopeAttributeSchemaVersionAliases()
Clears the set of aliases recognized for the schema version attribute in an envelope element. Only the main attribute name is recognized afterwards.


clearEnvelopeAttributeTaxonomyAliases

public void clearEnvelopeAttributeTaxonomyAliases()
Clears the set of aliases recognized for the taxonomy attribute in an envelope element. Only the main attribute name is recognized afterwards.


clearEnvelopeAttributeAliases

protected void clearEnvelopeAttributeAliases(FudgeXMLSettings.XMLEnvelopeAttribute attribute)
Parameters:
attribute -

setFieldAttributeName

public void setFieldAttributeName(String nameAttributeName)
Sets the name of the field name attribute on a field element. Set to null to omit the attribute from output or ignore in XML input.

Parameters:
nameAttributeName - name of the attribute

setFieldAttributeOrdinal

public void setFieldAttributeOrdinal(String ordinalAttributeName)
Sets the name of the field ordinal index attribute on a field element. Set to null to omit the attribute from output, or ignore in XML input.

Parameters:
ordinalAttributeName - name of the attribute

setFieldAttributeType

public void setFieldAttributeType(String typeAttributeName)
Sets the name of the type attribute on a field element. Set to null to omit the attribute from output, or ignore in XML input.

Parameters:
typeAttributeName - name of the attribute

setFieldAttributeEncoding

public void setFieldAttributeEncoding(String encodingAttributeName)
Sets the name of the encoding attribute on a field element. Set to null to omit the attribute from output, or ignore in XML input.

Parameters:
encodingAttributeName - name of the attribute

setFieldAttribute

protected void setFieldAttribute(FudgeXMLSettings.XMLFieldAttribute attribute,
                                 String attributeName)
Parameters:
attribute -
attributeName -

getFieldAttributeName

public String getFieldAttributeName()
Returns the name of the field name attribute in a field element. Returns null if the name should be omitted from output or ignored in XML input.

Returns:
name of the attribute

getFieldAttributeOrdinal

public String getFieldAttributeOrdinal()
Returns the name of the field ordinal attribute in a field element. Returns null if the ordinal should be omitted from output, or ignored in XML input.

Returns:
name of the attribute

getFieldAttributeType

public String getFieldAttributeType()
Returns the name of the type attribute in a field element. Returns null if the type should be omitted from output, or ignored in XML input.

Returns:
name of the attribute

getFieldAttributeEncoding

public String getFieldAttributeEncoding()
Returns the name of the encoding attribute of a field element. Returns null if the encoding should be omitted from output, or ignored in XML input.

Returns:
name of the attribute

getFieldAttribute

protected String getFieldAttribute(FudgeXMLSettings.XMLFieldAttribute attribute)
Parameters:
attribute -
Returns:

addFieldAttributeNameAlias

public void addFieldAttributeNameAlias(String nameAttributeName)
Adds an additional alias to recognize as a field name attribute of a field element when parsing XML input.

Parameters:
nameAttributeName - name of the attribute

addFieldAttributeOrdinalAlias

public void addFieldAttributeOrdinalAlias(String ordinalAttributeName)
Adds an additional alias to recognize as a field ordinal attribute when parsing XML input.

Parameters:
ordinalAttributeName - name of the attribute

addFieldAttributeTypeAlias

public void addFieldAttributeTypeAlias(String typeAttributeName)
Adds an additional alias to recognize as a field type attribute when parsing XML input.

Parameters:
typeAttributeName - name of the attribute

addFieldAttributeEncodingAlias

public void addFieldAttributeEncodingAlias(String encodingAttributeName)
Adds an additional alias to recognize as an encoding attribute when parsing XML input.

Parameters:
encodingAttributeName - name of the attribute

addFieldAttributeAlias

protected void addFieldAttributeAlias(FudgeXMLSettings.XMLFieldAttribute attribute,
                                      String attributeName)
Parameters:
attribute -
attributeName -

clearFieldAttributeNameAliases

public void clearFieldAttributeNameAliases()
Clears the aliases for field name attributes set by addFieldAttributeNameAlias(java.lang.String).


clearFieldAttributeOrdinalAliases

public void clearFieldAttributeOrdinalAliases()
Clears the aliases for field ordinal attributes set by addFieldAttributeOrdinalAlias(java.lang.String).


clearFieldAttributeTypeAliases

public void clearFieldAttributeTypeAliases()
Clears the aliases for field type attributes set by addFieldAttributeTypeAlias(java.lang.String).


clearFieldAttributeEncodingAliases

public void clearFieldAttributeEncodingAliases()
Clears the aliases for field encoding attributes set by addFieldAttributeEncodingAlias(java.lang.String).


clearFieldAttributeAliases

protected void clearFieldAttributeAliases(FudgeXMLSettings.XMLFieldAttribute attribute)
Parameters:
attribute -

setPreserveFieldNames

public void setPreserveFieldNames(boolean preserveFieldNames)
Set to use the field name as the element name when writing fields, or derive the field name from the element name when reading.

Parameters:
preserveFieldNames - true to map the field name to/from the element name

getPreserveFieldNames

public boolean getPreserveFieldNames()
Returns whether to map the field name to/from the element name.


setBooleanTrue

public void setBooleanTrue(String trueValue)
Sets the value to use for encoding a boolean true value, or to expect when decoding XML input.

Parameters:
trueValue - the XML content

getBooleanTrue

public String getBooleanTrue()
Returns the value to use for encoding a boolean true value, or to expect when decoding XML input.


addBooleanTrueAlias

public void addBooleanTrueAlias(String trueValue)
Adds an additional alias to recognize as a boolean true when decoding XML input.


clearBooleanTrueAliases

public void clearBooleanTrueAliases()
Removes any aliases registered with addBooleanTrueAlias(java.lang.String).


setBooleanFalse

public void setBooleanFalse(String falseValue)
Sets the value to use for encoding a boolean false value, or to expect when decoding XML input.

Parameters:
falseValue - the XML content

getBooleanFalse

public String getBooleanFalse()
Returns the value to use for encoding a boolean false value, or to expect when decoding XML input.


addBooleanFalseAlias

public void addBooleanFalseAlias(String falseValue)
Adds an additional alias to recognize as a boolean false value when decoding XML input.


clearBooleanFalseAliases

public void clearBooleanFalseAliases()
Removes any aliases registered with addBooleanFalseAlias(java.lang.String).


addBooleanAlias

protected void addBooleanAlias(boolean value,
                               String alias)
Parameters:
value -
alias -

clearBooleanAliases

protected void clearBooleanAliases(Boolean value)
Parameters:
value -

getStringsToBoolean

protected Map<String,Boolean> getStringsToBoolean()
Returns:

setBase64EncodingName

public void setBase64EncodingName(String value)
Sets the value to use, or expect, on an encoding attribute if the field data is written in Base-64.


getBase64EncodingName

public String getBase64EncodingName()
Returns the value to use, or expect, on an encoding attribute if the field data is written in Base-64.


addBase64EncodingAlias

public void addBase64EncodingAlias(String value)
Adds an additional alias to recognize as a Base-64 encoding when reading XML input.


getBase64EncodingAliases

protected Set<String> getBase64EncodingAliases()
Returns:

getBase64UnknownTypes

public boolean getBase64UnknownTypes()
Returns true if the data for unknown types should be encoded in Base-64.


setBase64UnknownTypes

public void setBase64UnknownTypes(boolean base64UnknownTypes)
Sets whether to encode unknown types in Base-64.


getIdentifiersToFudgeType

protected Map<String,Integer> getIdentifiersToFudgeType()
Returns:

getFudgeTypesToIdentifier

protected Map<Integer,String> getFudgeTypesToIdentifier()
Returns:

registerFudgeType

protected void registerFudgeType(int type,
                                 String... identifiers)
Parameters:
type -
identifiers -

fudgeTypeIdToString

public String fudgeTypeIdToString(int type)
Returns a type string for a Fudge type identifier.


stringToFudgeTypeId

public Integer stringToFudgeTypeId(String str)
Returns a Fudge type identifier for a given string.


getAppendFieldOrdinal

public boolean getAppendFieldOrdinal()
Returns true if the field ordinal should be appended to the field name when generating field elements.


setAppendFieldOrdinal

public void setAppendFieldOrdinal(boolean appendFieldOrdinal)
Sets whether to append the field ordinal to the default field name when generating field elements.



Copyright 2009-Present by OpenGamma Inc. and individual contributors
Released under the Apache License, Version 2.0