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.

  • It can validate JBI descriptor in XML form.
  • It can build class bindings from a XML form.
  • It can build the XML binding from classes form.

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

    This class is thread-safe.

    Since:
    PEtALS 2.2
    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 java.lang.String buildXmlStringJBIdescriptor(Jbi jbiDescriptorClass)
              Build the XML String from the JBI descriptor in Java classes form.
    static void validateJBIDescriptor(java.io.InputStream jbiDescriptorStream)
              Validate the given JBI descriptor against the JBI schema.
     
    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.

    buildXmlStringJBIdescriptor

    public static java.lang.String buildXmlStringJBIdescriptor(Jbi jbiDescriptorClass)
                                                        throws JBIDescriptorException
    Build the XML String from the JBI descriptor in Java classes form.

    Parameters:
    jbiDescriptorClass - The JBI Descriptor root class
    Returns:
    The String to fill with the JBI descriptor XML
    Throws:
    JBIDescriptorException - The exception raised during the marshaller creation or the exception raised during the build of the XML string.


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