Data Request Broker
2-3-release

fr.gael.drb.impl.sds
Class SdfFactory

java.lang.Object
  extended by fr.gael.drb.impl.sds.SdfFactory
All Implemented Interfaces:
DrbFactoryImpl

public final class SdfFactory
extends Object
implements DrbFactoryImpl

Factory for Structured Data Files.


Field Summary
static String SDF_2002_02_NAMESPACE
          The SDF 2002/02 namespace URI.
static String SDF_2004_12_NAMESPACE
          The SDF 2004/12 namespace URI.
static String SDF_2005_04_NAMESPACE
          The SDF 2005/04 namespace URI.
 
Constructor Summary
SdfFactory()
          Builds a default factory
 
Method Summary
static String getDefaultVersion()
          Allow to get the default version of the namespace use by SdfFactory.
 String getIdentifier()
          The scheme identifier of the implementation.
 String getName()
          The name of the implementation.
static void main(String[] args)
          Makes the class runnable for testing.
 DrbNode open(DrbNode base_node)
          Opens the node from an existing node.
 DrbNode open(DrbNode base_node, DrbNode schema_node, String schemaLocation)
          Opens a node using the base node and associated the schema node.
 DrbNode open(DrbNode base_node, XmlSchema xml_schema, String schema_path)
          Opens a node using the base node and associated the XML-Schema.
 DrbNode open(URL uri)
          Opens the node matching a given URI.
 DrbNode open(URL uri, DrbNode base_node)
          Opens the node matching a given URI from an existing node.
 void setSchema(String path)
          Sets the default SDF-Schema location In case of success a structure change event is fired on the current node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SDF_2005_04_NAMESPACE

public static final String SDF_2005_04_NAMESPACE
The SDF 2005/04 namespace URI.

See Also:
Constant Field Values

SDF_2004_12_NAMESPACE

public static final String SDF_2004_12_NAMESPACE
The SDF 2004/12 namespace URI.

See Also:
Constant Field Values

SDF_2002_02_NAMESPACE

public static final String SDF_2002_02_NAMESPACE
The SDF 2002/02 namespace URI.

See Also:
Constant Field Values
Constructor Detail

SdfFactory

public SdfFactory()
Builds a default factory

Method Detail

getDefaultVersion

public static String getDefaultVersion()
Allow to get the default version of the namespace use by SdfFactory.

Returns:
the default version of the namespace for SDF.

getIdentifier

public final String getIdentifier()
The scheme identifier of the implementation. Always returns "sdf" string, which is defined as the scheme identifier of the implementation.

Specified by:
getIdentifier in interface DrbFactoryImpl
Returns:
The "sdf" string.

getName

public final String getName()
The name of the implementation. Always returns "Structured Data File" string, which stands as the name of the implementation.

Specified by:
getName in interface DrbFactoryImpl
Returns:
The "Structured Data File" string.

setSchema

public final void setSchema(String path)
                     throws UnsupportedOperationException
Sets the default SDF-Schema location In case of success a structure change event is fired on the current node.

Parameters:
path - the schema path to be set.
Throws:
UnsupportedOperationException - This exception is raised when the schema cannot be applied to this node.

open

public final DrbNode open(URL uri)
Opens the node matching a given URI. This implementation does not support this operation and therefore always returns a null reference.

Specified by:
open in interface DrbFactoryImpl
Parameters:
uri - Unused.
Returns:
null.

open

public final DrbNode open(DrbNode base_node)
Opens the node from an existing node. This implementation does not support this operation and therefore always returns a null reference.

Specified by:
open in interface DrbFactoryImpl
Parameters:
base_node - Unused.
Returns:
null.

open

public final DrbNode open(URL uri,
                          DrbNode base_node)
Opens the node matching a given URI from an existing node. This implementation does not support this operation and therefore always returns a null reference.

Specified by:
open in interface DrbFactoryImpl
Parameters:
uri - Unused.
base_node - Unused.
Returns:
null.

open

public DrbNode open(DrbNode base_node,
                    DrbNode schema_node,
                    String schemaLocation)
Opens a node using the base node and associated the schema node. This operation creates and returns a DrbNode using an existing node as base or context. The input base node is asked for a RandomAccessFile implementation in order to get data from associated file. The schema node is used to describe the data structure of this file.
The reference to the input nodes shall not be null.

Parameters:
base_node - The input node to be used as RandomAccessFile.
schema_node - The input node to be used as data description.
schemaLocation - the location of the provided schema.
Returns:
A root node or null if an error occurred or if the implementation does not supports the input node.

open

public DrbNode open(DrbNode base_node,
                    XmlSchema xml_schema,
                    String schema_path)
Opens a node using the base node and associated the XML-Schema. This operation creates and returns a DrbNode using an existing node as base or context. The input base node is asked for a RandomAccessFile implementation in order to get data from associated file. The schema is used to describe the data structure of this file.
The reference to the input nodes shall not be null.

Parameters:
base_node - The input node to be used as RandomAccessFile.
xml_schema - The XML-Schema containing the SDF parameters.
schema_path - The path of the XML-Schema file.
Returns:
A root node or null if an error occured or if the implementation does not supports the input node.

main

public static void main(String[] args)
Makes the class runnable for testing.

Parameters:
args - main arguments

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .