org.gxml.sa
Interface GxAtomBridge<A,S>


public interface GxAtomBridge<A,S>

A part of the bridge that provides access to the system of atomic values.
This interface consists of several parts.


Method Summary
 A[] atomArray(int size)
          Allocates an empty array of atoms.
 A baseAtomFromForeignAtom(A derivedAtom)
           
 A castAs(A sourceAtom, SmName<S> targetType)
          Performs the casting of one atomic value to another.
 A castAs(A sourceAtom, SmNativeType targetType)
          Performs the casting of one atomic value to another.
 A compile(java.lang.String srcval, SmName<S> dataType)
          Compile the atomic value from the lexical representation.
 A compile(java.lang.String srcval, SmName<S> dataType, SmPrefixResolver<S> resolver)
           
 A compile(java.lang.String srcval, SmNativeType dataType)
           
 A compile(java.lang.String srcval, SmNativeType dataType, SmPrefixResolver<S> resolver)
           
 A createBase64Binary(byte[] base64BinaryValue)
           
 A createBoolean(boolean value)
          Returns an xs:boolean based upon the value.
 A createByte(byte byteValue)
          Returns an xs:byte based upon the value.
 A createDate(int year, int month, int dayOfMonth, int timezone)
          Returns an xs:date atomic value.
 A createDateTime(int year, int month, int dayOfMonth, int hour, int minute, int second, int millis, java.math.BigDecimal remainderSecond, int offsetInMinutes)
          Returns an xs:dateTime atomic value.
 A createDay(int dayOfMonth, int timezone)
          Returns an xs:gDay based upon the value.
 A createDayTimeDuration(java.math.BigDecimal seconds)
           
 A createDecimal(java.math.BigDecimal decimalValue)
           
 A createDouble(double value)
          Returns an xs:double based upon the value.
 A createFloat(float floatValue)
          Returns an xs:float based upon the value.
 A createHexBinary(byte[] hexBinaryValue)
          Returns an xs:hexBinary based upon the value.
 A createInt(int intValue)
          Returns an xs:int based upon the value.
 A createInteger(java.math.BigInteger value)
          Returns an xs:integer based upon the value.
 A createLong(long longValue)
          Returns an xs:long based upon the value.
 A createMonth(int month, int timezone)
          Returns an xs:gMonth based upon the value.
 A createMonthDay(int month, int dayOfMonth, int timezone)
          Returns an xs:gMonthDay based upon the value.
 A createQName(java.lang.String namespaceURI, java.lang.String localName, java.lang.String prefix)
          Constructs an expanded-QName.
 A createShort(short shortValue)
          Returns an xs:short based upon the value.
 A createString(java.lang.String strval)
          Creates an implementation xs:string from an String.
 A createTime(int hourOfDay, int minute, int second, int millis, java.math.BigDecimal fractionalSecond, int timezone)
          Creates an xs:time atomic value.
 A createUntypedAtomic(java.lang.String strval)
          Creates an implementation xs:untypedAtomic from a String.
 A createURI(java.net.URI uri)
           
 A createYear(int year, int timezone)
          Returns an xs:gYear based upon the value.
 A createYearMonth(int year, int month, int timezone)
          Returns an xs:gYearMonth based upon the value.
 A createYearMonthDuration(int totalMonths)
           
 byte[] getBase64Binary(A atom)
           
 SmName<S> getBaseType(SmName<S> dataType)
           
 boolean getBoolean(A atom)
           
 A getBooleanFalse()
           
 A getBooleanTrue()
           
 byte getByte(A atom)
           
 java.lang.String getC14NForm(A atom)
          Returns the canonical string representation of the atomic value.
 SmName<S> getDataType(A atom)
          Determine the specific XML data type of an atom managed by this manager.
 int getDayOfMonth(A gregorian)
           
 java.math.BigDecimal getDecimal(A atom)
           
 double getDouble(A atom)
           
 int getDurationTotalMonths(A duration)
           
 java.math.BigDecimal getDurationTotalSeconds(A duration)
           
 float getFloat(A atom)
           
 java.math.BigDecimal getFractionalSecondPart(A gregorian)
          Returns the fractional part of the seconds component.
 int getGmtOffset(A gregorian)
          Returns the offset, in minutes, from GMT.
 byte[] getHexBinary(A arg)
           
 int getHourOfDay(A gregorian)
          Returns the hours component of the Gregorian atomic value.
 int getInt(A atom)
           
 java.math.BigInteger getInteger(A atom)
           
 int getIntegralSecondPart(A gregorian)
          Returns the integral part of the seconds component.
 long getLong(A atom)
           
 int getMinute(A gregorian)
          Returns the minutes component of the Gregorian atomic value.
 int getMonth(A gregorian)
           
 GxNameBridge<S> getNameBridge()
          Returns a GxNameBridge implementation consistent with this atom bridge.
 SmNativeType getNativeType(A atom)
          Determine the nearest ancestor Built-in type of an atom managed by this manager.
 javax.xml.namespace.QName getNotation(A notation)
           
 javax.xml.namespace.QName getQName(A atom)
          Convert an atom known to be a the internal representation of an xs:QName to QName.
 java.math.BigDecimal getSecondsAsBigDecimal(A gregorian)
          Returns the whole of the seconds value.
 short getShort(A atom)
           
 java.lang.String getString(A atom)
          Converts the atom, assumed to be an implementation xs:string, to get a string value.
 java.net.URI getURI(A atom)
           
 java.lang.String getXPath10Form(A atom)
          Returns the XPath 1.0 string representation of the atomic value.
 java.lang.String getXQuery10Form(A atom)
          Returns the XQuery 1.0 string representation of the atomic value.
 int getYear(A gregorian)
           
 boolean isForeignAtom(A atom)
          Determines whether the specified atom is foreign (non native).
 boolean isWhiteSpace(A atom)
          Determines whether the specified atom represents XML white space.
 A makeForeignAtom(SmName<S> atomType, A baseAtom)
           
 java.util.List<A> wrapAtom(A atom)
          Promotes a single atom into an Iterable sequence containing the same single atom.
 

Method Detail

atomArray

A[] atomArray(int size)
Allocates an empty array of atoms.

Parameters:
size - The size of the array of atoms.

baseAtomFromForeignAtom

A baseAtomFromForeignAtom(A derivedAtom)

castAs

A castAs(A sourceAtom,
         SmName<S> targetType)
         throws GxAtomCastException
Performs the casting of one atomic value to another.

Parameters:
sourceAtom - The source atomic value for the cast.
targetType - The target type.
Returns:
The cast atom or null if the input was null.
Throws:
GxAtomCastException - if a cast does not exist between the two types or fails because of incompatible data.

castAs

A castAs(A sourceAtom,
         SmNativeType targetType)
         throws GxAtomCastException
Performs the casting of one atomic value to another.

Parameters:
sourceAtom - The source atomic value for the cast.
targetType - The target type.
Returns:
The cast atom or null if the input was null.
Throws:
GxAtomCastException - if a cast does not exist between the two types or fails because of incompatible data.

compile

A compile(java.lang.String srcval,
          SmName<S> dataType)
          throws GxAtomCastException
Compile the atomic value from the lexical representation. This method is typically used for validation.

Parameters:
srcval - The lexical representation of the atomic value.
dataType - The specific data type
Throws:
GxAtomCastException - If the lexical representation is not valid for the atomic value type.

compile

A compile(java.lang.String srcval,
          SmName<S> dataType,
          SmPrefixResolver<S> resolver)
          throws GxAtomCastException
Throws:
GxAtomCastException

compile

A compile(java.lang.String srcval,
          SmNativeType dataType)
          throws GxAtomCastException
Throws:
GxAtomCastException

compile

A compile(java.lang.String srcval,
          SmNativeType dataType,
          SmPrefixResolver<S> resolver)
          throws GxAtomCastException
Throws:
GxAtomCastException

createBase64Binary

A createBase64Binary(byte[] base64BinaryValue)

createBoolean

A createBoolean(boolean value)
Returns an xs:boolean based upon the value.


createByte

A createByte(byte byteValue)
Returns an xs:byte based upon the value.


createDate

A createDate(int year,
             int month,
             int dayOfMonth,
             int timezone)
Returns an xs:date atomic value.


createDateTime

A createDateTime(int year,
                 int month,
                 int dayOfMonth,
                 int hour,
                 int minute,
                 int second,
                 int millis,
                 java.math.BigDecimal remainderSecond,
                 int offsetInMinutes)
Returns an xs:dateTime atomic value.


createDay

A createDay(int dayOfMonth,
            int timezone)
Returns an xs:gDay based upon the value.


createDayTimeDuration

A createDayTimeDuration(java.math.BigDecimal seconds)

createDecimal

A createDecimal(java.math.BigDecimal decimalValue)

createDouble

A createDouble(double value)
Returns an xs:double based upon the value.


createFloat

A createFloat(float floatValue)
Returns an xs:float based upon the value.


createHexBinary

A createHexBinary(byte[] hexBinaryValue)
Returns an xs:hexBinary based upon the value.


createInt

A createInt(int intValue)
Returns an xs:int based upon the value.


createInteger

A createInteger(java.math.BigInteger value)
Returns an xs:integer based upon the value.


createLong

A createLong(long longValue)
Returns an xs:long based upon the value.


createMonth

A createMonth(int month,
              int timezone)
Returns an xs:gMonth based upon the value.


createMonthDay

A createMonthDay(int month,
                 int dayOfMonth,
                 int timezone)
Returns an xs:gMonthDay based upon the value.


createQName

A createQName(java.lang.String namespaceURI,
              java.lang.String localName,
              java.lang.String prefix)
Constructs an expanded-QName.

Parameters:
namespaceURI - The namespace for the expanded-QName.
localName - The local-name part of the expanded-QName.
prefix - The prefix of the expanded-QName.
The prefix parameter is only a hint that may be used to achieve consistency in round-trip situations.

createShort

A createShort(short shortValue)
Returns an xs:short based upon the value.


createString

A createString(java.lang.String strval)
Creates an implementation xs:string from an String.
Returns null if the argument is null.

Parameters:
strval - The String value of the created implementation xs:string.

createTime

A createTime(int hourOfDay,
             int minute,
             int second,
             int millis,
             java.math.BigDecimal fractionalSecond,
             int timezone)
Creates an xs:time atomic value.


createUntypedAtomic

A createUntypedAtomic(java.lang.String strval)
Creates an implementation xs:untypedAtomic from a String.
Returns null if the argument is null.

Parameters:
strval - The String value of the created implementation xs:untypedAtomic.

createURI

A createURI(java.net.URI uri)

createYear

A createYear(int year,
             int timezone)
Returns an xs:gYear based upon the value.


createYearMonth

A createYearMonth(int year,
                  int month,
                  int timezone)
Returns an xs:gYearMonth based upon the value.


createYearMonthDuration

A createYearMonthDuration(int totalMonths)

getBase64Binary

byte[] getBase64Binary(A atom)

getBaseType

SmName<S> getBaseType(SmName<S> dataType)

getBoolean

boolean getBoolean(A atom)

getBooleanFalse

A getBooleanFalse()

getBooleanTrue

A getBooleanTrue()

getByte

byte getByte(A atom)

getC14NForm

java.lang.String getC14NForm(A atom)
Returns the canonical string representation of the atomic value.

Parameters:
atom - The atom to be serialized.
Returns:
The serialization format.

getDataType

SmName<S> getDataType(A atom)
Determine the specific XML data type of an atom managed by this manager.

Parameters:
atom - The atomic value for which the data-type is required.

getDayOfMonth

int getDayOfMonth(A gregorian)

getDecimal

java.math.BigDecimal getDecimal(A atom)

getDouble

double getDouble(A atom)

getDurationTotalMonths

int getDurationTotalMonths(A duration)

getDurationTotalSeconds

java.math.BigDecimal getDurationTotalSeconds(A duration)

getFloat

float getFloat(A atom)

getFractionalSecondPart

java.math.BigDecimal getFractionalSecondPart(A gregorian)
Returns the fractional part of the seconds component.
For Gregorian values that do not have a seconds component, returns zero.

Parameters:
gregorian - The gregorian atomic value.

getGmtOffset

int getGmtOffset(A gregorian)
Returns the offset, in minutes, from GMT.
This is an optional component of the Gregorian atomic value.
Returns javax.xml.datatype.DatatypeConstants.FIELD_UNDEFINED if the Gregorian value has no timezone.

Parameters:
gregorian - The gregorian atomic value.

getHexBinary

byte[] getHexBinary(A arg)

getHourOfDay

int getHourOfDay(A gregorian)
Returns the hours component of the Gregorian atomic value.
For Gregorian values that do not have an hours component, returns 0.

Parameters:
gregorian - The gregorian atomic value.

getInt

int getInt(A atom)

getInteger

java.math.BigInteger getInteger(A atom)

getIntegralSecondPart

int getIntegralSecondPart(A gregorian)
Returns the integral part of the seconds component.
For Gregorian values that do not have a seconds component, returns 0.

Parameters:
gregorian - The gregorian atomic value.

getLong

long getLong(A atom)

getMinute

int getMinute(A gregorian)
Returns the minutes component of the Gregorian atomic value.
For Gregorian values that do not have a minutes component, returns 0.

Parameters:
gregorian - The gregorian atomic value.

getMonth

int getMonth(A gregorian)

getNameBridge

GxNameBridge<S> getNameBridge()
Returns a GxNameBridge implementation consistent with this atom bridge.


getNativeType

SmNativeType getNativeType(A atom)
Determine the nearest ancestor Built-in type of an atom managed by this manager.

Parameters:
atom - The atomic value for which the data-type is required.

getNotation

javax.xml.namespace.QName getNotation(A notation)

getQName

javax.xml.namespace.QName getQName(A atom)
Convert an atom known to be a the internal representation of an xs:QName to QName.
If the argument is null, this function returns null.

Parameters:
atom - The internal representation; may be null.

getSecondsAsBigDecimal

java.math.BigDecimal getSecondsAsBigDecimal(A gregorian)
Returns the whole of the seconds value.
For Gregorian values that do not have a seconds component, returns null.

Parameters:
gregorian - The gregorian atomic value.

getShort

short getShort(A atom)

getString

java.lang.String getString(A atom)
Converts the atom, assumed to be an implementation xs:string, to get a string value.
Returns null if the argument is null.

Parameters:
atom - The atom that is assumed to represent an xs:string.

getURI

java.net.URI getURI(A atom)

getXPath10Form

java.lang.String getXPath10Form(A atom)
Returns the XPath 1.0 string representation of the atomic value.

Parameters:
atom - The atom to be serialized.
Returns:
The serialization format.

getXQuery10Form

java.lang.String getXQuery10Form(A atom)
Returns the XQuery 1.0 string representation of the atomic value.

Parameters:
atom - The atom to be serialized.
Returns:
The serialization format.

getYear

int getYear(A gregorian)

isForeignAtom

boolean isForeignAtom(A atom)
Determines whether the specified atom is foreign (non native).

Parameters:
atom - The atomic value to be tested.
Returns:
true if the atom is foreign, otherwise false.

isWhiteSpace

boolean isWhiteSpace(A atom)
Determines whether the specified atom represents XML white space.

Parameters:
atom - The atomic value to be tested for being entirely white space.

makeForeignAtom

A makeForeignAtom(SmName<S> atomType,
                  A baseAtom)

wrapAtom

java.util.List<A> wrapAtom(A atom)
Promotes a single atom into an Iterable sequence containing the same single atom.
Note this method is provided for performance reasons. Some implementations may implement Iterable on their atoms to avoid physically wrapping the atom.

Parameters:
atom - The atom to be wrapped. May be null. If null is passed as an argument, the implementation must return an empty Iterable. This provides consistent semantics for the


Copyright © 2009 TIBCO Software Inc. All Rights Reserved.