org.xquark.mapping
Interface StorageContext


public interface StorageContext

Provide access to storage system variables.

This interface is passed to generator, notably user generators.

See Also:
UserGenerator

Method Summary
 java.lang.Object getActualNodeData()
          Return the XML Schema actual value attached to the current node if any, converted to a java object.
 java.sql.Connection getConnection()
          Return the JDBC Connection used by the storage module.
 java.lang.String getDocumentID()
          get the document ID set by the user or internally generated.
 long getDocumentOID()
          get the numeric ID allocated for the document.
 java.lang.String getLocalName()
          Return the local name of the node being stored.
 java.lang.String getNamespaceURI()
          Return the namespace URI of the node being stored.
 java.lang.String getNodeData()
          Return the character data attached to the current node if any.
 int getNodeRank()
          Return the rank (within its siblings) of the current node being stored.
 java.lang.String getNormalizedNodeData()
          Return the character data attached to the current node if any, normalized according the XML Schema recommendation.
 long getOID()
          Return the local (to a storage operation) OID (Object IDentifier) of the current node being stored.
 short getPathOID()
          Return the path OID (Object IDentifier) of the current node being stored.
 java.lang.String getQName()
          Return the Full Qualified Name of the node being stored.
 java.lang.Object getRefValue(int tableIndex, int columnIndex)
          Return the character data stored in a tuple waiting to be stored.
 long getUOID()
          Return the universal OID (Object IDentifier) of the current node being stored.
 

Method Detail

getNodeRank

public int getNodeRank()
Return the rank (within its siblings) of the current node being stored.

Returns:
a numeric OID

getNodeData

public java.lang.String getNodeData()
Return the character data attached to the current node if any.

Returns:
a String containing concatenation of all character data attached to the current node. Null if node has no value.

getNormalizedNodeData

public java.lang.String getNormalizedNodeData()
Return the character data attached to the current node if any, normalized according the XML Schema recommendation.

Returns:
a String containing concatenation of all character data attached to the current node. Null if node has no value.

getActualNodeData

public java.lang.Object getActualNodeData()
Return the XML Schema actual value attached to the current node if any, converted to a java object.

Returns:
a java object corresponding to the XML Schema actual value of the node. Null if node has no value. The type of the object is either a standard Java object or a specific one defined by the XQuark XML specification in the org.xquark.schema.datatypes package. The mapping used is the following :
XML schema base built-in primitive typeJava class
stringString
booleanBoolean
decimalBigDecimal or Long if type facet ensure it fits.
floatFloat
doubleDouble
QNameorg.xquark.schema.datatypes.QName
NOTATIONorg.xquark.schema.datatypes.QName
durationorg.xquark.schema.datatypes.Duration
dateTimeorg.xquark.schema.datatypes.DateTime
timeorg.xquark.schema.datatypes.DateTime
dateorg.xquark.schema.datatypes.DateTime
gYearMonthorg.xquark.schema.datatypes.DateTime
gYearorg.xquark.schema.datatypes.DateTime
gMonthDayorg.xquark.schema.datatypes.DateTime
gDayorg.xquark.schema.datatypes.DateTime
gMonthorg.xquark.schema.datatypes.DateTime
hexBinaryorg.xquark.schema.datatypes.ByteArray
base64Binaryorg.xquark.schema.datatypes.ByteArray
anyURIorg.xquark.schema.datatypes.URI
unionnot supported
listList
anySimpleTypeString

getQName

public java.lang.String getQName()
Return the Full Qualified Name of the node being stored.

Returns:
a string of the form prefix:name if the node being stored is an element or an attribute. Null, otherwise.

getLocalName

public java.lang.String getLocalName()
Return the local name of the node being stored.

Returns:
a String if the node being stored is an element or an attribute. Null, otherwise.

getNamespaceURI

public java.lang.String getNamespaceURI()
Return the namespace URI of the node being stored.

Returns:
a String if the node being stored is an element or an attribute. Null, otherwise.

getRefValue

public java.lang.Object getRefValue(int tableIndex,
                                    int columnIndex)
Return the character data stored in a tuple waiting to be stored.

Parameters:
tableIndex - index of the table mapping corresponding to tuple containing data.
columnIndex - index of the column in the table mapping used to identify the data.
Returns:
an Object.

getConnection

public java.sql.Connection getConnection()
Return the JDBC Connection used by the storage module.

This connection may be used, for example, to fetch information from the relational database in order to generate a column value.

Returns:
a JDBC connection.

getDocumentID

public java.lang.String getDocumentID()
get the document ID set by the user or internally generated.

This method is only implemented by the Repository.

Returns:
the document ID. null for the Bridge.

getDocumentOID

public long getDocumentOID()
get the numeric ID allocated for the document.

This method is only implemented by the Repository.

Returns:
the document ID. -1 for the Bridge.

getOID

public long getOID()
Return the local (to a storage operation) OID (Object IDentifier) of the current node being stored.

This method is only implemented by the Repository.

Returns:
a numeric OID. -1 for the Bridge.

getUOID

public long getUOID()
Return the universal OID (Object IDentifier) of the current node being stored. This ID is global to the XML Repository.

This method is only implemented by the Repository.

Returns:
a numeric OID. -1 for the Bridge.

getPathOID

public short getPathOID()
Return the path OID (Object IDentifier) of the current node being stored.

This method is only implemented by the Repository.

Returns:
a numeric OID. -1 for the Bridge.


Copyright © 2004 Université de Versailles Saint-Quentin, XQuark Group. All rights reserved.