org.ow2.petals.jbi.descriptor.original
Class JBIDescriptorBuilder

java.lang.Object
  extended by org.ow2.petals.jbi.descriptor.original.JBIDescriptorBuilder

public final class JBIDescriptorBuilder
extends java.lang.Object

This Class defines the JBI Descriptor builder for the kernel.

Note that this Builder is based on the original JBI schema; it doesn't control the JBI extension parts.

This class is thread-safe.

Author:
Roland NAUDIN - EBM WebSourcing

Field Summary
static java.lang.String JBI_DESCRIPTOR_RESOURCE
          Standard location to the JBI Descriptor resource.
static java.lang.String XSD_JBI
          JBI schema name
 
Method Summary
static Jbi buildJavaJBIDescriptor(java.io.InputStream jbiDescriptorStream)
           Build the Java bindings from the JBI descriptor in XML form.
static void buildXmlJBIdescriptor(Jbi jbiDescriptorClass, org.w3c.dom.Node jbiDescriptorNode)
          Build the XML nodes from the JBI descriptor in Java classes form.
static void validateJBIDescriptor(java.io.InputStream jbiDescriptorStream)
          Validate the given JBI descriptor against the JBI schema.
static void writeJBIdescriptor(Jbi jbiDescriptorClass, java.io.OutputStream jbiDescrOutputStream)
          Write the JBI descriptor XML into an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XSD_JBI

public static final java.lang.String XSD_JBI
JBI schema name

See Also:
Constant Field Values

JBI_DESCRIPTOR_RESOURCE

public static final java.lang.String JBI_DESCRIPTOR_RESOURCE
Standard location to the JBI Descriptor resource.

Method Detail

validateJBIDescriptor

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

Parameters:
jbiDescriptorStream -
Throws:
JBIException - The validation has failed
JBIDescriptorException - Failed to create the validator

buildJavaJBIDescriptor

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

Build the Java bindings from the JBI descriptor in XML form. The validation against the JBI schema is processed during the transformation.

Note: The input stream is closed because of the XML parser.

Parameters:
jbiDescriptorStream - The JBI descriptor in XML form as InputStream
Returns:
The root object (instance of Jbi) of the JBI descriptor
Throws:
JBIDescriptorException - The exception raised during the unmarshaller creation or the exception raised during the build of the java bindings.

buildXmlJBIdescriptor

public static void buildXmlJBIdescriptor(Jbi jbiDescriptorClass,
                                         org.w3c.dom.Node jbiDescriptorNode)
                                  throws JBIDescriptorException
Build the XML nodes 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 unmarshaller creation or the exception raised during the build of the XML nodes.

writeJBIdescriptor

public static void writeJBIdescriptor(Jbi jbiDescriptorClass,
                                      java.io.OutputStream jbiDescrOutputStream)
                               throws JBIDescriptorException

Write the JBI descriptor XML into an output stream.

Note: The output stream is not close by this method.

Parameters:
jbiDescriptorClass - The JBI Descriptor root class
jbiDescrOutputStream - The output stream where the JBI descriptor will be written
Throws:
JBIDescriptorException - The exception raised during the marshaller creation or the exception raised during the build of the XML string.


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