org.apache.felix.scrplugin.xml
Class ComponentDescriptorIO

java.lang.Object
  extended by org.apache.felix.scrplugin.xml.ComponentDescriptorIO

public class ComponentDescriptorIO
extends java.lang.Object

ComponentDescriptorIO is a helper class to read and write component descriptor files.


Nested Class Summary
protected static class ComponentDescriptorIO.XmlHandler
          A content handler for parsing the component descriptions.
 
Field Summary
static java.lang.String INNER_NAMESPACE_URI
          The inner namespace - used for all inner elements.
 
Constructor Summary
ComponentDescriptorIO()
           
 
Method Summary
static java.util.List<java.lang.String> generateDescriptorFiles(DescriptionContainer module, Options options, Log logger)
          Generate descriptor file(s)
protected static void generateImplementationXML(ComponentContainer component, org.xml.sax.ContentHandler contentHandler)
          Write the xml for an Implementation.
protected static void generatePropertyXML(PropertyDescription property, org.xml.sax.ContentHandler contentHandler)
          Write the xml for a property.
protected static void generateReferenceXML(ComponentDescription component, DescriptionContainer module, ReferenceDescription reference, org.xml.sax.ContentHandler contentHandler)
          Write the xml for a Reference.
protected static void generateServiceXML(ServiceDescription service, org.xml.sax.ContentHandler contentHandler)
          Write the xml for a service.
protected static void generateXML(DescriptionContainer module, java.util.List<ComponentContainer> components, java.io.File descriptorFile, Log logger)
          Generate the xml top level element and start streaming the components.
protected static void generateXML(java.lang.String namespace, DescriptionContainer module, ComponentContainer container, org.xml.sax.ContentHandler contentHandler)
          Write the xml for a Component
static java.util.List<ClassDescription> read(java.io.InputStream file, java.lang.ClassLoader classLoader, IssueLog iLog, java.lang.String location)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INNER_NAMESPACE_URI

public static final java.lang.String INNER_NAMESPACE_URI
The inner namespace - used for all inner elements.

See Also:
Constant Field Values
Constructor Detail

ComponentDescriptorIO

public ComponentDescriptorIO()
Method Detail

read

public static java.util.List<ClassDescription> read(java.io.InputStream file,
                                                    java.lang.ClassLoader classLoader,
                                                    IssueLog iLog,
                                                    java.lang.String location)
                                             throws SCRDescriptorException
Throws:
SCRDescriptorException

generateXML

protected static void generateXML(DescriptionContainer module,
                                  java.util.List<ComponentContainer> components,
                                  java.io.File descriptorFile,
                                  Log logger)
                           throws org.xml.sax.SAXException,
                                  java.io.IOException,
                                  javax.xml.transform.TransformerException
Generate the xml top level element and start streaming the components.

Parameters:
components -
contentHandler -
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException

generateXML

protected static void generateXML(java.lang.String namespace,
                                  DescriptionContainer module,
                                  ComponentContainer container,
                                  org.xml.sax.ContentHandler contentHandler)
                           throws org.xml.sax.SAXException
Write the xml for a Component

Parameters:
component -
contentHandler -
Throws:
org.xml.sax.SAXException

generateImplementationXML

protected static void generateImplementationXML(ComponentContainer component,
                                                org.xml.sax.ContentHandler contentHandler)
                                         throws org.xml.sax.SAXException
Write the xml for an Implementation.

Parameters:
implementation -
contentHandler -
Throws:
org.xml.sax.SAXException

generateServiceXML

protected static void generateServiceXML(ServiceDescription service,
                                         org.xml.sax.ContentHandler contentHandler)
                                  throws org.xml.sax.SAXException
Write the xml for a service.

Parameters:
service -
contentHandler -
Throws:
org.xml.sax.SAXException

generatePropertyXML

protected static void generatePropertyXML(PropertyDescription property,
                                          org.xml.sax.ContentHandler contentHandler)
                                   throws org.xml.sax.SAXException
Write the xml for a property.

Parameters:
property -
contentHandler -
Throws:
org.xml.sax.SAXException

generateReferenceXML

protected static void generateReferenceXML(ComponentDescription component,
                                           DescriptionContainer module,
                                           ReferenceDescription reference,
                                           org.xml.sax.ContentHandler contentHandler)
                                    throws org.xml.sax.SAXException
Write the xml for a Reference.

Parameters:
reference -
contentHandler -
Throws:
org.xml.sax.SAXException

generateDescriptorFiles

public static java.util.List<java.lang.String> generateDescriptorFiles(DescriptionContainer module,
                                                                       Options options,
                                                                       Log logger)
                                                                throws SCRDescriptorException,
                                                                       SCRDescriptorFailureException
Generate descriptor file(s)

Throws:
SCRDescriptorException
SCRDescriptorFailureException


Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.