org.apache.aries.blueprint.parser
Class Parser

java.lang.Object
  extended by org.apache.aries.blueprint.parser.Parser

public class Parser
extends Object

TODO: javadoc

Version:
$Rev: 1135256 $, $Date: 2011-06-13 21:09:27 +0100 (Mon, 13 Jun 2011) $

Field Summary
static String ACTIVATION_ATTRIBUTE
           
static String ACTIVATION_DEFAULT
           
static String ACTIVATION_EAGER
           
static String ACTIVATION_LAZY
           
static String ARGUMENT_ELEMENT
           
static String ARRAY_ELEMENT
           
static String AUTO_EXPORT_ALL
           
static String AUTO_EXPORT_ATTRIBUTE
           
static String AUTO_EXPORT_CLASS_HIERARCHY
           
static String AUTO_EXPORT_DEFAULT
           
static String AUTO_EXPORT_DISABLED
           
static String AUTO_EXPORT_INTERFACES
           
static String AVAILABILITY_ATTRIBUTE
           
static String AVAILABILITY_DEFAULT
           
static String AVAILABILITY_MANDATORY
           
static String AVAILABILITY_OPTIONAL
           
static String BEAN_ELEMENT
           
static String BIND_METHOD_ATTRIBUTE
           
static String BLUEPRINT_ELEMENT
           
static String BLUEPRINT_NAMESPACE
           
static String CLASS_ATTRIBUTE
           
static String COMPONENT_ID_ATTRIBUTE
           
static String COMPONENT_NAME_ATTRIBUTE
           
static String DEFAULT_ACTIVATION_ATTRIBUTE
           
static String DEFAULT_AVAILABILITY_ATTRIBUTE
           
static String DEFAULT_TIMEOUT_ATTRIBUTE
           
static String DEPENDS_ON_ATTRIBUTE
           
static String DESCRIPTION_ELEMENT
           
static String DESTROY_METHOD_ATTRIBUTE
           
static String ENTRY_ELEMENT
           
static String FACTORY_METHOD_ATTRIBUTE
           
static String FACTORY_REF_ATTRIBUTE
           
static String FILTER_ATTRIBUTE
           
static String ID_ATTRIBUTE
           
static String IDREF_ELEMENT
           
static String INDEX_ATTRIBUTE
           
static String INIT_METHOD_ATTRIBUTE
           
static String INTERFACE_ATTRIBUTE
           
static String INTERFACES_ELEMENT
           
static String KEY_ATTRIBUTE
           
static String KEY_ELEMENT
           
static String KEY_REF_ATTRIBUTE
           
static String KEY_TYPE_ATTRIBUTE
           
static String LIST_ELEMENT
           
static String MAP_ELEMENT
           
static String MEMBER_TYPE_ATTRIBUTE
           
static String NAME_ATTRIBUTE
           
static String NULL_ELEMENT
           
static String PROP_ELEMENT
           
static String PROPERTY_ELEMENT
           
static String PROPS_ELEMENT
           
static String RANKING_ATTRIBUTE
           
static String RANKING_DEFAULT
           
static String REF_ATTRIBUTE
           
static String REF_ELEMENT
           
static String REFERENCE_ELEMENT
           
static String REFERENCE_LIST_ELEMENT
           
static String REFERENCE_LISTENER_ELEMENT
           
static String REGISTRATION_LISTENER_ELEMENT
           
static String REGISTRATION_METHOD_ATTRIBUTE
           
static String SCOPE_ATTRIBUTE
           
static String SERVICE_ELEMENT
           
static String SERVICE_PROPERTIES_ELEMENT
           
static String SET_ELEMENT
           
static String TIMEOUT_ATTRIBUTE
           
static String TIMEOUT_DEFAULT
           
static String TYPE_ATTRIBUTE
           
static String TYPE_CONVERTERS_ELEMENT
           
static String UNBIND_METHOD_ATTRIBUTE
           
static String UNREGISTRATION_METHOD_ATTRIBUTE
           
static String USE_SERVICE_OBJECT
           
static String USE_SERVICE_REFERENCE
           
static String VALUE_ATTRIBUTE
           
static String VALUE_ELEMENT
           
static String VALUE_REF_ATTRIBUTE
           
static String VALUE_TYPE_ATTRIBUTE
           
 
Constructor Summary
Parser()
           
Parser(String idPrefix)
           
 
Method Summary
 String generateId()
           
 String getDefaultActivation()
           
 String getDefaultAvailability()
           
 String getDefaultTimeout()
           
 String getId(Element element)
           
 Set<URI> getNamespaces()
           
static boolean isBlueprintNamespace(String ns)
           
static boolean isIgnorableAttributeNamespace(String ns)
          Test if this namespace uri does not require a Namespace Handler.
 void parse(InputStream inputStream)
          Parse an input stream for blueprint xml.
 void parse(List<URL> urls)
          Parse blueprint xml referred to by a list of URLs
 org.osgi.service.blueprint.reflect.BeanProperty parseBeanProperty(org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent, Element element)
           
<T> T
parseElement(Class<T> type, org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent, Element element)
           
 List<String> parseInterfaceNames(Element element)
           
 org.osgi.service.blueprint.reflect.MapMetadata parseMap(Element element, org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent)
           
 org.osgi.service.blueprint.reflect.PropsMetadata parseProps(Element element)
           
 org.osgi.service.blueprint.reflect.RegistrationListener parseRegistrationListener(Element element, org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent)
           
 org.osgi.service.blueprint.reflect.MapMetadata parseServiceProperties(Element element, org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent)
           
 void populate(NamespaceHandlerSet handlers, ComponentDefinitionRegistry registry)
           
 void validate(Schema schema)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLUEPRINT_NAMESPACE

public static final String BLUEPRINT_NAMESPACE
See Also:
Constant Field Values

BLUEPRINT_ELEMENT

public static final String BLUEPRINT_ELEMENT
See Also:
Constant Field Values

DESCRIPTION_ELEMENT

public static final String DESCRIPTION_ELEMENT
See Also:
Constant Field Values

TYPE_CONVERTERS_ELEMENT

public static final String TYPE_CONVERTERS_ELEMENT
See Also:
Constant Field Values

BEAN_ELEMENT

public static final String BEAN_ELEMENT
See Also:
Constant Field Values

ARGUMENT_ELEMENT

public static final String ARGUMENT_ELEMENT
See Also:
Constant Field Values

REF_ELEMENT

public static final String REF_ELEMENT
See Also:
Constant Field Values

IDREF_ELEMENT

public static final String IDREF_ELEMENT
See Also:
Constant Field Values

LIST_ELEMENT

public static final String LIST_ELEMENT
See Also:
Constant Field Values

SET_ELEMENT

public static final String SET_ELEMENT
See Also:
Constant Field Values

MAP_ELEMENT

public static final String MAP_ELEMENT
See Also:
Constant Field Values

ARRAY_ELEMENT

public static final String ARRAY_ELEMENT
See Also:
Constant Field Values

PROPS_ELEMENT

public static final String PROPS_ELEMENT
See Also:
Constant Field Values

PROP_ELEMENT

public static final String PROP_ELEMENT
See Also:
Constant Field Values

PROPERTY_ELEMENT

public static final String PROPERTY_ELEMENT
See Also:
Constant Field Values

NULL_ELEMENT

public static final String NULL_ELEMENT
See Also:
Constant Field Values

VALUE_ELEMENT

public static final String VALUE_ELEMENT
See Also:
Constant Field Values

SERVICE_ELEMENT

public static final String SERVICE_ELEMENT
See Also:
Constant Field Values

REFERENCE_ELEMENT

public static final String REFERENCE_ELEMENT
See Also:
Constant Field Values

REFERENCE_LIST_ELEMENT

public static final String REFERENCE_LIST_ELEMENT
See Also:
Constant Field Values

INTERFACES_ELEMENT

public static final String INTERFACES_ELEMENT
See Also:
Constant Field Values

REFERENCE_LISTENER_ELEMENT

public static final String REFERENCE_LISTENER_ELEMENT
See Also:
Constant Field Values

SERVICE_PROPERTIES_ELEMENT

public static final String SERVICE_PROPERTIES_ELEMENT
See Also:
Constant Field Values

REGISTRATION_LISTENER_ELEMENT

public static final String REGISTRATION_LISTENER_ELEMENT
See Also:
Constant Field Values

ENTRY_ELEMENT

public static final String ENTRY_ELEMENT
See Also:
Constant Field Values

KEY_ELEMENT

public static final String KEY_ELEMENT
See Also:
Constant Field Values

DEFAULT_ACTIVATION_ATTRIBUTE

public static final String DEFAULT_ACTIVATION_ATTRIBUTE
See Also:
Constant Field Values

DEFAULT_TIMEOUT_ATTRIBUTE

public static final String DEFAULT_TIMEOUT_ATTRIBUTE
See Also:
Constant Field Values

DEFAULT_AVAILABILITY_ATTRIBUTE

public static final String DEFAULT_AVAILABILITY_ATTRIBUTE
See Also:
Constant Field Values

NAME_ATTRIBUTE

public static final String NAME_ATTRIBUTE
See Also:
Constant Field Values

ID_ATTRIBUTE

public static final String ID_ATTRIBUTE
See Also:
Constant Field Values

CLASS_ATTRIBUTE

public static final String CLASS_ATTRIBUTE
See Also:
Constant Field Values

INDEX_ATTRIBUTE

public static final String INDEX_ATTRIBUTE
See Also:
Constant Field Values

TYPE_ATTRIBUTE

public static final String TYPE_ATTRIBUTE
See Also:
Constant Field Values

VALUE_ATTRIBUTE

public static final String VALUE_ATTRIBUTE
See Also:
Constant Field Values

VALUE_REF_ATTRIBUTE

public static final String VALUE_REF_ATTRIBUTE
See Also:
Constant Field Values

KEY_ATTRIBUTE

public static final String KEY_ATTRIBUTE
See Also:
Constant Field Values

KEY_REF_ATTRIBUTE

public static final String KEY_REF_ATTRIBUTE
See Also:
Constant Field Values

REF_ATTRIBUTE

public static final String REF_ATTRIBUTE
See Also:
Constant Field Values

COMPONENT_ID_ATTRIBUTE

public static final String COMPONENT_ID_ATTRIBUTE
See Also:
Constant Field Values

INTERFACE_ATTRIBUTE

public static final String INTERFACE_ATTRIBUTE
See Also:
Constant Field Values

DEPENDS_ON_ATTRIBUTE

public static final String DEPENDS_ON_ATTRIBUTE
See Also:
Constant Field Values

AUTO_EXPORT_ATTRIBUTE

public static final String AUTO_EXPORT_ATTRIBUTE
See Also:
Constant Field Values

RANKING_ATTRIBUTE

public static final String RANKING_ATTRIBUTE
See Also:
Constant Field Values

TIMEOUT_ATTRIBUTE

public static final String TIMEOUT_ATTRIBUTE
See Also:
Constant Field Values

FILTER_ATTRIBUTE

public static final String FILTER_ATTRIBUTE
See Also:
Constant Field Values

COMPONENT_NAME_ATTRIBUTE

public static final String COMPONENT_NAME_ATTRIBUTE
See Also:
Constant Field Values

AVAILABILITY_ATTRIBUTE

public static final String AVAILABILITY_ATTRIBUTE
See Also:
Constant Field Values

REGISTRATION_METHOD_ATTRIBUTE

public static final String REGISTRATION_METHOD_ATTRIBUTE
See Also:
Constant Field Values

UNREGISTRATION_METHOD_ATTRIBUTE

public static final String UNREGISTRATION_METHOD_ATTRIBUTE
See Also:
Constant Field Values

BIND_METHOD_ATTRIBUTE

public static final String BIND_METHOD_ATTRIBUTE
See Also:
Constant Field Values

UNBIND_METHOD_ATTRIBUTE

public static final String UNBIND_METHOD_ATTRIBUTE
See Also:
Constant Field Values

KEY_TYPE_ATTRIBUTE

public static final String KEY_TYPE_ATTRIBUTE
See Also:
Constant Field Values

VALUE_TYPE_ATTRIBUTE

public static final String VALUE_TYPE_ATTRIBUTE
See Also:
Constant Field Values

MEMBER_TYPE_ATTRIBUTE

public static final String MEMBER_TYPE_ATTRIBUTE
See Also:
Constant Field Values

SCOPE_ATTRIBUTE

public static final String SCOPE_ATTRIBUTE
See Also:
Constant Field Values

INIT_METHOD_ATTRIBUTE

public static final String INIT_METHOD_ATTRIBUTE
See Also:
Constant Field Values

DESTROY_METHOD_ATTRIBUTE

public static final String DESTROY_METHOD_ATTRIBUTE
See Also:
Constant Field Values

ACTIVATION_ATTRIBUTE

public static final String ACTIVATION_ATTRIBUTE
See Also:
Constant Field Values

FACTORY_REF_ATTRIBUTE

public static final String FACTORY_REF_ATTRIBUTE
See Also:
Constant Field Values

FACTORY_METHOD_ATTRIBUTE

public static final String FACTORY_METHOD_ATTRIBUTE
See Also:
Constant Field Values

AUTO_EXPORT_DISABLED

public static final String AUTO_EXPORT_DISABLED
See Also:
Constant Field Values

AUTO_EXPORT_INTERFACES

public static final String AUTO_EXPORT_INTERFACES
See Also:
Constant Field Values

AUTO_EXPORT_CLASS_HIERARCHY

public static final String AUTO_EXPORT_CLASS_HIERARCHY
See Also:
Constant Field Values

AUTO_EXPORT_ALL

public static final String AUTO_EXPORT_ALL
See Also:
Constant Field Values

AUTO_EXPORT_DEFAULT

public static final String AUTO_EXPORT_DEFAULT
See Also:
Constant Field Values

RANKING_DEFAULT

public static final String RANKING_DEFAULT
See Also:
Constant Field Values

AVAILABILITY_MANDATORY

public static final String AVAILABILITY_MANDATORY
See Also:
Constant Field Values

AVAILABILITY_OPTIONAL

public static final String AVAILABILITY_OPTIONAL
See Also:
Constant Field Values

AVAILABILITY_DEFAULT

public static final String AVAILABILITY_DEFAULT
See Also:
Constant Field Values

TIMEOUT_DEFAULT

public static final String TIMEOUT_DEFAULT
See Also:
Constant Field Values

USE_SERVICE_OBJECT

public static final String USE_SERVICE_OBJECT
See Also:
Constant Field Values

USE_SERVICE_REFERENCE

public static final String USE_SERVICE_REFERENCE
See Also:
Constant Field Values

ACTIVATION_EAGER

public static final String ACTIVATION_EAGER
See Also:
Constant Field Values

ACTIVATION_LAZY

public static final String ACTIVATION_LAZY
See Also:
Constant Field Values

ACTIVATION_DEFAULT

public static final String ACTIVATION_DEFAULT
See Also:
Constant Field Values
Constructor Detail

Parser

public Parser()

Parser

public Parser(String idPrefix)
Method Detail

parse

public void parse(InputStream inputStream)
           throws Exception
Parse an input stream for blueprint xml.

Parameters:
inputStream - The data to parse. The caller is responsible for closing the stream afterwards.
Throws:
Exception - on parse error

parse

public void parse(List<URL> urls)
           throws Exception
Parse blueprint xml referred to by a list of URLs

Parameters:
urls - URLs to blueprint xml to parse
Throws:
Exception - on parse error

getNamespaces

public Set<URI> getNamespaces()

populate

public void populate(NamespaceHandlerSet handlers,
                     ComponentDefinitionRegistry registry)

validate

public void validate(Schema schema)

parseElement

public <T> T parseElement(Class<T> type,
                          org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent,
                          Element element)

parseBeanProperty

public org.osgi.service.blueprint.reflect.BeanProperty parseBeanProperty(org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent,
                                                                         Element element)

parseProps

public org.osgi.service.blueprint.reflect.PropsMetadata parseProps(Element element)

parseMap

public org.osgi.service.blueprint.reflect.MapMetadata parseMap(Element element,
                                                               org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent)

parseServiceProperties

public org.osgi.service.blueprint.reflect.MapMetadata parseServiceProperties(Element element,
                                                                             org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent)

parseRegistrationListener

public org.osgi.service.blueprint.reflect.RegistrationListener parseRegistrationListener(Element element,
                                                                                         org.osgi.service.blueprint.reflect.ComponentMetadata enclosingComponent)

getDefaultTimeout

public String getDefaultTimeout()

getDefaultAvailability

public String getDefaultAvailability()

getDefaultActivation

public String getDefaultActivation()

parseInterfaceNames

public List<String> parseInterfaceNames(Element element)

generateId

public String generateId()

getId

public String getId(Element element)

isBlueprintNamespace

public static boolean isBlueprintNamespace(String ns)

isIgnorableAttributeNamespace

public static boolean isIgnorableAttributeNamespace(String ns)
Test if this namespace uri does not require a Namespace Handler.

  • XMLConstants.RELAXNG_NS_URI
  • XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI
  • XMLConstants.W3C_XML_SCHEMA_NS_URI
  • XMLConstants.W3C_XPATH_DATATYPE_NS_URI
  • XMLConstants.W3C_XPATH_DATATYPE_NS_URI
  • XMLConstants.XML_DTD_NS_URI
  • XMLConstants.XML_NS_URI
  • XMLConstants.XMLNS_ATTRIBUTE_NS_URI

    Parameters:
    ns - URI to be tested.
    Returns:
    true if the uri does not require a namespace handler.


  • Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.