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 booleanFlag for detecting the first element.protected booleanFlag for elements inside a component elementprivate final org.osgi.framework.Bundleprivate List<ComponentMetadata> private ComponentMetadataprivate ServiceMetadataprivate final booleanprivate final booleanprivate final BundleLoggerprivate PropertyMetadataprivate PropertyMetadataprotected StringOverride namespace.private StringBuilder -
Constructor Summary
ConstructorsConstructorDescriptionXmlHandler(org.osgi.framework.Bundle bundle, BundleLogger logger, boolean globalObsoleteFactoryComponentFactory, boolean globalDelayedKeepInstances) -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidendElement(String uri, String localName, String qName) Called to retrieve the service descriptorsprivate PropertiesreadPropertiesEntry(String entryName) Reads the name property file from the bundle owning this descriptor.voidstartElement(String uri, String localName, String qName, Attributes attributes) Methods inherited from class 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:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin 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 isnullor no entry with the given name exists in the bundle or an error occurrs reading the properties file.
-