org.apache.felix.scrplugin.xml
Class ComponentDescriptorIO

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

public class ComponentDescriptorIO
extends 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 String INNER_NAMESPACE_URI
          The inner namespace - used for all inner elements.
static String NAMESPACE_URI_1_0
          The namespace for R4.1 - Version 1.0
static String NAMESPACE_URI_1_1
          The namespace for R4.2 - Version 1.1
static String NAMESPACE_URI_1_1_FELIX
          The namespace for R4.2+FELIX-1893 - Version 1.1-felix
 
Constructor Summary
ComponentDescriptorIO()
           
 
Method Summary
protected static void generateXML(Components components, ContentHandler contentHandler, boolean isScrPrivateFile)
          Generate the xml top level element and start streaming the components.
protected static void generateXML(Implementation implementation, ContentHandler contentHandler)
          Write the xml for a Implementation.
protected static void generateXML(Interface interf, ContentHandler contentHandler)
          Write the xml for a Interface.
protected static void generateXML(Property property, ContentHandler contentHandler, boolean isScrPrivateFile)
          Write the xml for a Property.
protected static void generateXML(Service service, ContentHandler contentHandler)
          Write the xml for a Service.
protected static void generateXML(String namespace, Component component, ContentHandler contentHandler, boolean isScrPrivateFile)
          Write the xml for a Component.
protected static void generateXML(String namespace, Reference reference, ContentHandler contentHandler, boolean isScrPrivateFile)
          Write the xml for a Reference.
static Components read(InputStream file)
           
static void write(Components components, File file, boolean isScrPrivateFile)
          Write the component descriptors to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE_URI_1_0

public static final String NAMESPACE_URI_1_0
The namespace for R4.1 - Version 1.0

See Also:
Constant Field Values

NAMESPACE_URI_1_1

public static final String NAMESPACE_URI_1_1
The namespace for R4.2 - Version 1.1

See Also:
Constant Field Values

NAMESPACE_URI_1_1_FELIX

public static final String NAMESPACE_URI_1_1_FELIX
The namespace for R4.2+FELIX-1893 - Version 1.1-felix

See Also:
Constant Field Values

INNER_NAMESPACE_URI

public static final 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 Components read(InputStream file)
                       throws SCRDescriptorException
Throws:
SCRDescriptorException

write

public static void write(Components components,
                         File file,
                         boolean isScrPrivateFile)
                  throws SCRDescriptorException
Write the component descriptors to the file.

Parameters:
components -
file -
Throws:
SCRDescriptorException

generateXML

protected static void generateXML(Components components,
                                  ContentHandler contentHandler,
                                  boolean isScrPrivateFile)
                           throws SAXException
Generate the xml top level element and start streaming the components.

Parameters:
components -
contentHandler -
Throws:
SAXException

generateXML

protected static void generateXML(String namespace,
                                  Component component,
                                  ContentHandler contentHandler,
                                  boolean isScrPrivateFile)
                           throws SAXException
Write the xml for a Component.

Parameters:
component -
contentHandler -
Throws:
SAXException

generateXML

protected static void generateXML(Implementation implementation,
                                  ContentHandler contentHandler)
                           throws SAXException
Write the xml for a Implementation.

Parameters:
implementation -
contentHandler -
Throws:
SAXException

generateXML

protected static void generateXML(Service service,
                                  ContentHandler contentHandler)
                           throws SAXException
Write the xml for a Service.

Parameters:
service -
contentHandler -
Throws:
SAXException

generateXML

protected static void generateXML(Interface interf,
                                  ContentHandler contentHandler)
                           throws SAXException
Write the xml for a Interface.

Parameters:
interf -
contentHandler -
Throws:
SAXException

generateXML

protected static void generateXML(Property property,
                                  ContentHandler contentHandler,
                                  boolean isScrPrivateFile)
                           throws SAXException
Write the xml for a Property.

Parameters:
property -
contentHandler -
Throws:
SAXException

generateXML

protected static void generateXML(String namespace,
                                  Reference reference,
                                  ContentHandler contentHandler,
                                  boolean isScrPrivateFile)
                           throws SAXException
Write the xml for a Reference.

Parameters:
reference -
contentHandler -
Throws:
SAXException


Copyright © 2011 Apache Software Foundation. All Rights Reserved.