org.ow2.petals.component.framework.jbidescriptor
Class JBIDescriptorBuilder

java.lang.Object
  extended by org.ow2.petals.component.framework.jbidescriptor.JBIDescriptorBuilder

public class JBIDescriptorBuilder
extends java.lang.Object

CDK JBI descriptor Builder. Provide marshalling/unmarshalling features.

Author:
Christophe HAMERLING - EBM WebSourcing, Roland NAUDIN - EBM WebSourcing

Field Summary
static java.lang.String ABSTRACT_CDKJBI_XSD
           
static java.lang.String CDKEXTENSIONS_XSD
          Extensions schema
static java.lang.String CDKJBI_XSD
          CDK schema
 
Constructor Summary
JBIDescriptorBuilder()
           
 
Method Summary
static Jbi buildJavaJBIDescriptor(java.io.InputStream jbiDescriptorStream)
           Build the Jbi Java binding from the given JBI descriptor in XML Stream form.
static Jbi buildJavaJBIDescriptor(java.io.Reader jbiDescriptorReader)
           Build the Jbi Java binding from the given JBI descriptor in XML character reader form.
static org.w3c.dom.Document buildXmlJBIdescriptor(Jbi jbiDescriptorClass)
          Build the XML nodes tree from the JBI descriptor in Java classes form.
static void buildXmlJBIdescriptor(Jbi jbiDescriptorClass, org.w3c.dom.Node jbiDescriptorNode)
          Build the XML nodes tree from the JBI descriptor in Java classes form.
static void buildXmlJBIdescriptor(Jbi jbiDescriptorClass, java.io.OutputStream ouputStream)
          Build the output Stream from the JBI descriptor in Java classes form.
static void close()
          Free singleton resources.
static void validateJBIDescriptor(java.io.InputStream jbiDescriptorStream)
          Validate the given JBI descriptor against the CDK JBI schema.
static void validateJBIDescriptor(java.io.InputStream jbiDescriptorStream, java.lang.String componentName)
          Validate the given JBI descriptor against the component implementation JBI schemas.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CDKJBI_XSD

public static final java.lang.String CDKJBI_XSD
CDK schema

See Also:
Constant Field Values

ABSTRACT_CDKJBI_XSD

public static final java.lang.String ABSTRACT_CDKJBI_XSD
See Also:
Constant Field Values

CDKEXTENSIONS_XSD

public static final java.lang.String CDKEXTENSIONS_XSD
Extensions schema

See Also:
Constant Field Values
Constructor Detail

JBIDescriptorBuilder

public JBIDescriptorBuilder()
Method Detail

close

public static final void close()
Free singleton resources. If the JBIDescriptorBuilder is used after to be freed, resources will be re-allocated.


validateJBIDescriptor

public static void validateJBIDescriptor(java.io.InputStream jbiDescriptorStream)
                                  throws CDKJBIDescriptorException
Validate the given JBI descriptor against the CDK JBI schema.

Parameters:
jbiDescriptorStream -
Throws:
CDKJBIDescriptorException

validateJBIDescriptor

public static void validateJBIDescriptor(java.io.InputStream jbiDescriptorStream,
                                         java.lang.String componentName)
                                  throws CDKJBIDescriptorException
Validate the given JBI descriptor against the component implementation JBI schemas.

Parameters:
jbiDescriptorStream -
Throws:
CDKJBIDescriptorException - FIXME: The structure of XSDs with the redefine feature doesn't work, maybe a Xerces bug?

buildJavaJBIDescriptor

public static Jbi buildJavaJBIDescriptor(java.io.InputStream jbiDescriptorStream)
                                  throws CDKJBIDescriptorException

Build the Jbi Java binding from the given JBI descriptor in XML Stream form.

Note : if the stream is initialized from a String, prefer to use

Parameters:
jbiDescriptorStream - the XML JBI descriptor stream
Returns:
the Jbi instance representing the JBI descriptor
Throws:
CDKJBIDescriptorException - impossible to create the Java bindings

buildJavaJBIDescriptor

public static Jbi buildJavaJBIDescriptor(java.io.Reader jbiDescriptorReader)
                                  throws CDKJBIDescriptorException

Build the Jbi Java binding from the given JBI descriptor in XML character reader form.

Note : MUST be used to parse a JBI descriptor available as String.

Parameters:
jbiDescriptorReader - the XML JBI descriptor character reader
Returns:
the Jbi instance representing the JBI descriptor
Throws:
CDKJBIDescriptorException - impossible to create the Java bindings

buildXmlJBIdescriptor

public static void buildXmlJBIdescriptor(Jbi jbiDescriptorClass,
                                         org.w3c.dom.Node jbiDescriptorNode)
                                  throws CDKJBIDescriptorException
Build the XML nodes tree from the JBI descriptor in Java classes form.

Parameters:
jbiDescriptorClass - The JBI Descriptor root class
jbiDescriptorNode - The XML Node to fill with the JBI descriptor XML nodes
Throws:
JBIDescriptorException - The exception raised during the marshaller creation or the exception raised during the build of the XML nodes.
CDKJBIDescriptorException

buildXmlJBIdescriptor

public static org.w3c.dom.Document buildXmlJBIdescriptor(Jbi jbiDescriptorClass)
                                                  throws CDKJBIDescriptorException
Build the XML nodes tree from the JBI descriptor in Java classes form. A default Document id built-in and filled with the created nodes.

Parameters:
jbiDescriptorClass - The JBI Descriptor root class
Returns:
The built-in @ code Document} filled with the generated nodes
Throws:
JBIDescriptorException - The exception raised during the marshaller creation or the exception raised during the build of the XML nodes.
CDKJBIDescriptorException

buildXmlJBIdescriptor

public static void buildXmlJBIdescriptor(Jbi jbiDescriptorClass,
                                         java.io.OutputStream ouputStream)
                                  throws CDKJBIDescriptorException
Build the output Stream from the JBI descriptor in Java classes form.

Parameters:
jbiDescriptorClass - The JBI Descriptor root class
jbiDescriptorNode - The output Stream to fill with the JBI descriptor
Throws:
JBIDescriptorException - The exception raised during the marshaller creation or the exception raised during the build of the XML nodes.
CDKJBIDescriptorException


Copyright © 2005-2012 Petals Link (EBM Websourcing). All Rights Reserved.