com.springsource.bundlor.internal.support
Class SpringApplicationContextArtefactAnalyser

java.lang.Object
  extended by com.springsource.bundlor.internal.support.AbstractXmlDocumentArtefactAnalyser
      extended by com.springsource.bundlor.internal.support.SpringApplicationContextArtefactAnalyser
All Implemented Interfaces:
ArtefactAnalyser, ManifestReader

public class SpringApplicationContextArtefactAnalyser
extends AbstractXmlDocumentArtefactAnalyser
implements ManifestReader

An analyzer for an Application Context located in a JAR file. Analyzes the list of package names that are found in bean declaration class attributes.

Concurrent Semantics
Threadsafe.

Author:
Ben Hale

Nested Class Summary
private static class SpringApplicationContextArtefactAnalyser.SpringNamespaceContext
           
 
Field Summary
private  javax.xml.xpath.XPathExpression classAttributeExpression
           
private  javax.xml.xpath.XPathExpression classValueExpression
           
private static java.lang.String DEFAULT_CONTEXT_LOCATION
          The default context location in Spring DM
private static java.util.List<java.lang.String> DEFAULT_CONTEXT_LOCATIONS
           
private  javax.xml.xpath.XPathExpression packageExpression
           
private  java.util.List<java.lang.String> springContextPaths
           
private  java.lang.Object springContextPathsMonitor
           
private static java.lang.String XPATH_EXPRESSION_CLASS_ATTRIBUTES
           
private static java.lang.String XPATH_EXPRESSION_CLASS_VALUES
           
private static java.lang.String XPATH_EXPRESSION_PACKAGE_ATTRIBUTES
           
 
Constructor Summary
SpringApplicationContextArtefactAnalyser()
           
 
Method Summary
(package private)  void analyse(org.w3c.dom.Document doc, java.lang.String artefactName, PartialManifest partialManifest)
           
 boolean canAnalyse(java.lang.String artefactName)
          Can this ArtefactAnalyser analyse the artefact with the supplied name.
private  java.util.List<com.springsource.util.osgi.manifest.parse.HeaderDeclaration> parseTemplate(java.lang.String template)
           
 void readJarManifest(com.springsource.util.parser.manifest.ManifestContents manifest)
          Read the source JAR's manifest before it is used to create the bundle manifest
 void readManifestTemplate(com.springsource.util.parser.manifest.ManifestContents manifestTemplate)
          Read the manifest template before it is used to create the bundle manifest
private  boolean selectedByLocation(java.lang.String name, java.util.List<java.lang.String> springContextPaths)
           
 
Methods inherited from class com.springsource.bundlor.internal.support.AbstractXmlDocumentArtefactAnalyser
analyse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONTEXT_LOCATION

private static final java.lang.String DEFAULT_CONTEXT_LOCATION
The default context location in Spring DM

See Also:
Constant Field Values

DEFAULT_CONTEXT_LOCATIONS

private static final java.util.List<java.lang.String> DEFAULT_CONTEXT_LOCATIONS

XPATH_EXPRESSION_CLASS_VALUES

private static final java.lang.String XPATH_EXPRESSION_CLASS_VALUES
See Also:
Constant Field Values

XPATH_EXPRESSION_CLASS_ATTRIBUTES

private static final java.lang.String XPATH_EXPRESSION_CLASS_ATTRIBUTES
See Also:
Constant Field Values

XPATH_EXPRESSION_PACKAGE_ATTRIBUTES

private static final java.lang.String XPATH_EXPRESSION_PACKAGE_ATTRIBUTES
See Also:
Constant Field Values

classValueExpression

private final javax.xml.xpath.XPathExpression classValueExpression

classAttributeExpression

private final javax.xml.xpath.XPathExpression classAttributeExpression

packageExpression

private final javax.xml.xpath.XPathExpression packageExpression

springContextPaths

private final java.util.List<java.lang.String> springContextPaths

springContextPathsMonitor

private final java.lang.Object springContextPathsMonitor
Constructor Detail

SpringApplicationContextArtefactAnalyser

public SpringApplicationContextArtefactAnalyser()
Method Detail

readJarManifest

public void readJarManifest(com.springsource.util.parser.manifest.ManifestContents manifest)
Description copied from interface: ManifestReader
Read the source JAR's manifest before it is used to create the bundle manifest

Specified by:
readJarManifest in interface ManifestReader
Parameters:
manifest - the JAR manifest

readManifestTemplate

public void readManifestTemplate(com.springsource.util.parser.manifest.ManifestContents manifestTemplate)
Description copied from interface: ManifestReader
Read the manifest template before it is used to create the bundle manifest

Specified by:
readManifestTemplate in interface ManifestReader
Parameters:
manifestTemplate - the manifest template

analyse

void analyse(org.w3c.dom.Document doc,
             java.lang.String artefactName,
             PartialManifest partialManifest)
       throws java.lang.Exception
Specified by:
analyse in class AbstractXmlDocumentArtefactAnalyser
Throws:
java.lang.Exception

canAnalyse

public boolean canAnalyse(java.lang.String artefactName)
Description copied from interface: ArtefactAnalyser
Can this ArtefactAnalyser analyse the artefact with the supplied name.

Specified by:
canAnalyse in interface ArtefactAnalyser
Parameters:
artefactName - the name of the artefact.
Returns:
true if the artefact can be analysed; otherwise false.

selectedByLocation

private boolean selectedByLocation(java.lang.String name,
                                   java.util.List<java.lang.String> springContextPaths)

parseTemplate

private java.util.List<com.springsource.util.osgi.manifest.parse.HeaderDeclaration> parseTemplate(java.lang.String template)