Package org.apache.felix.scr.impl.xml
Class XmlHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.felix.scr.impl.xml.XmlHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
XML Parser for the component XML
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Flag for detecting the first element.protected boolean
Flag for elements inside a component elementprivate final org.osgi.framework.Bundle
private List<ComponentMetadata>
private ComponentMetadata
private ServiceMetadata
private final boolean
private final boolean
private final BundleLogger
private PropertyMetadata
private PropertyMetadata
protected String
Override namespace.private StringBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionXmlHandler
(org.osgi.framework.Bundle bundle, BundleLogger logger, boolean globalObsoleteFactoryComponentFactory, boolean globalDelayedKeepInstances) -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) void
endElement
(String uri, String localName, String qName) Called to retrieve the service descriptorsprivate Properties
readPropertiesEntry
(String entryName) Reads the name property file from the bundle owning this descriptor.void
startElement
(String uri, String localName, String qName, Attributes attributes) Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
Field Details
-
m_bundle
private final org.osgi.framework.Bundle m_bundle -
m_logger
-
m_globalObsoleteFactoryComponentFactory
private final boolean m_globalObsoleteFactoryComponentFactory -
m_globalDelayedKeepInstances
private final boolean m_globalDelayedKeepInstances -
m_currentComponent
-
m_currentService
-
m_components
-
m_pendingProperty
-
m_pendingFactoryProperty
-
propertyBuilder
-
firstElement
protected boolean firstElementFlag for detecting the first element. -
overrideNamespace
Override namespace. -
isComponent
protected boolean isComponentFlag for elements inside a component element
-
-
Constructor Details
-
XmlHandler
public XmlHandler(org.osgi.framework.Bundle bundle, BundleLogger logger, boolean globalObsoleteFactoryComponentFactory, boolean globalDelayedKeepInstances)
-
-
Method Details
-
getComponentMetadataList
Called to retrieve the service descriptors- Returns:
- A list of service descriptors
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
readPropertiesEntry
Reads the name property file from the bundle owning this descriptor. All properties read from the properties file are added to the current component's property meta data list.- Parameters:
entryName
- The name of the bundle entry containing the propertes to be added. This must not benull
.- Throws:
SAXException
- If the entry name isnull
or no entry with the given name exists in the bundle or an error occurrs reading the properties file.
-