org.sca4j.introspection.xml
Interface LoaderHelper


public interface LoaderHelper

Interface for the helper class for loading intents and policy sets into elements aginst which intents and policies can be declared.

Version:
$Revision$ $Date$

Method Summary
 javax.xml.namespace.QName createQName(java.lang.String name, javax.xml.stream.XMLStreamReader reader)
          Constructs a QName from the given name.
 java.net.URI getURI(java.lang.String target)
          Convert a component URI in the form ${componentName}/${serviceName} to a URI of the form ${componentName}#${serviceName}
 org.w3c.dom.Document loadKey(javax.xml.stream.XMLStreamReader reader)
          Load the value of the attribute key from the current element.
 void loadPolicySetsAndIntents(org.sca4j.scdl.PolicyAware policyAware, javax.xml.stream.XMLStreamReader reader, IntrospectionContext context)
          Loads policy sets and intents defined against bindings, implementations, services, references and components.
 org.w3c.dom.Document loadValue(javax.xml.stream.XMLStreamReader reader)
          Load an XML value from a Stax stream.
 java.util.List<javax.xml.namespace.QName> parseListOfQNames(javax.xml.stream.XMLStreamReader reader, java.lang.String attribute)
          Parses a list of qualified names.
 java.util.List<java.net.URI> parseListOfUris(javax.xml.stream.XMLStreamReader reader, java.lang.String attribute)
          Parses a list of URIs contained in a attribute.
 

Method Detail

loadKey

org.w3c.dom.Document loadKey(javax.xml.stream.XMLStreamReader reader)
Load the value of the attribute key from the current element.

Parameters:
reader - a stream containing a property value
Returns:
a standalone document containing the value
Throws:
javax.xml.stream.XMLStreamException - if there was a problem reading the stream

loadValue

org.w3c.dom.Document loadValue(javax.xml.stream.XMLStreamReader reader)
                               throws javax.xml.stream.XMLStreamException
Load an XML value from a Stax stream.

The reader must be positioned at an element whose body contains an XML value. This will typically be an SCA <property> element (either in a <composite> or in a <component>). The resulting document comprises a <value> element whose body content will be that of the original <property> element.

Parameters:
reader - a stream containing a property value
Returns:
a standalone document containing the value
Throws:
javax.xml.stream.XMLStreamException - if there was a problem reading the stream

loadPolicySetsAndIntents

void loadPolicySetsAndIntents(org.sca4j.scdl.PolicyAware policyAware,
                              javax.xml.stream.XMLStreamReader reader,
                              IntrospectionContext context)
Loads policy sets and intents defined against bindings, implementations, services, references and components. Errors will be collated in the IntrospectionContext.

Parameters:
policyAware - Element against which policy sets and intents are declared.
reader - XML stream reader from where the attributes are read.
context - the introspection context.

getURI

java.net.URI getURI(java.lang.String target)
Convert a component URI in the form ${componentName}/${serviceName} to a URI of the form ${componentName}#${serviceName}

Parameters:
target - the target URI to convert
Returns:
a URI where the fragment represents the service name

parseListOfQNames

java.util.List<javax.xml.namespace.QName> parseListOfQNames(javax.xml.stream.XMLStreamReader reader,
                                                            java.lang.String attribute)
                                                            throws InvalidPrefixException
Parses a list of qualified names.

Parameters:
reader - XML stream reader.
attribute - Attribute that contains the list of qualified names.
Returns:
Set containing the qualified names.
Throws:
InvalidPrefixException - If the qualified name cannot be resolved.

createQName

javax.xml.namespace.QName createQName(java.lang.String name,
                                      javax.xml.stream.XMLStreamReader reader)
                                      throws InvalidPrefixException
Constructs a QName from the given name. If a namespace prefix is not specified in the name, the namespace context is used

Parameters:
name - the name to parse
reader - the XML stream reader
Returns:
the parsed QName
Throws:
InvalidPrefixException - if a specified namespace prefix is invalid

parseListOfUris

java.util.List<java.net.URI> parseListOfUris(javax.xml.stream.XMLStreamReader reader,
                                             java.lang.String attribute)
Parses a list of URIs contained in a attribute.

Parameters:
reader - the XML stream reader
attribute - the attribute to parse
Returns:
the list of URIs contained in that attribute, or null if the attribute is not present


Copyright © 2008-2011 Service Symphony. All Rights Reserved.