com.springsource.bundlor.support.contributors
Class BlueprintArtifactAnalyzer

java.lang.Object
  extended by com.springsource.bundlor.support.contributors.AbstractXmlDocumentArtefactAnalyser
      extended by com.springsource.bundlor.support.contributors.AbstractXmlConfigurationArtifactAnalyzer
          extended by com.springsource.bundlor.support.contributors.BlueprintArtifactAnalyzer
All Implemented Interfaces:
ArtifactAnalyzer, ManifestReader

public final class BlueprintArtifactAnalyzer
extends AbstractXmlConfigurationArtifactAnalyzer
implements ManifestReader

An analyzer for an OSGi Blueprint located in a JAR file. Analyzes the list of package names that are found in the context.

Concurrent Semantics
Not threadsafe.

Author:
Ben Hale

Field Summary
private static java.lang.String CLASS_ATTRIBUTES
           
private static java.lang.String CLASS_VALUES
           
private static java.lang.String CONTEXT_PATH_HEADER
           
private  java.util.List<java.lang.String> contextPaths
           
private static java.lang.String DEFAULT_CONTEXT_LOCATION
           
private static java.util.Map<java.lang.String,java.lang.String> NAMESPACE_MAPPING
           
 
Constructor Summary
BlueprintArtifactAnalyzer()
           
 
Method Summary
 boolean canAnalyse(java.lang.String artefactName)
          Can this ArtifactAnalyzer analyse the artefact with the supplied name.
protected  java.lang.String getClassAttributesXPathExpression()
           
protected  java.lang.String getClassValueXPathExpression()
           
protected  java.util.Map<java.lang.String,java.lang.String> getNamespaceMapping()
           
protected  java.lang.String getPackageXPathExpression()
           
private  java.util.List<com.springsource.util.osgi.manifest.parse.HeaderDeclaration> parseTemplate(java.lang.String template)
           
private  void readContextPaths(com.springsource.util.parser.manifest.ManifestContents manifest)
           
 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
 
Methods inherited from class com.springsource.bundlor.support.contributors.AbstractXmlConfigurationArtifactAnalyzer
analyse
 
Methods inherited from class com.springsource.bundlor.support.contributors.AbstractXmlDocumentArtefactAnalyser
analyse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_ATTRIBUTES

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

CLASS_VALUES

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

NAMESPACE_MAPPING

private static final java.util.Map<java.lang.String,java.lang.String> NAMESPACE_MAPPING

DEFAULT_CONTEXT_LOCATION

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

CONTEXT_PATH_HEADER

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

contextPaths

private final java.util.List<java.lang.String> contextPaths
Constructor Detail

BlueprintArtifactAnalyzer

public BlueprintArtifactAnalyzer()
Method Detail

readJarManifest

public final 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 final 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

readContextPaths

private final void readContextPaths(com.springsource.util.parser.manifest.ManifestContents manifest)

parseTemplate

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

canAnalyse

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

Specified by:
canAnalyse in interface ArtifactAnalyzer
Returns:
true if the artefact can be analysed; otherwise false.

getClassAttributesXPathExpression

protected java.lang.String getClassAttributesXPathExpression()
Specified by:
getClassAttributesXPathExpression in class AbstractXmlConfigurationArtifactAnalyzer

getClassValueXPathExpression

protected java.lang.String getClassValueXPathExpression()
Specified by:
getClassValueXPathExpression in class AbstractXmlConfigurationArtifactAnalyzer

getPackageXPathExpression

protected java.lang.String getPackageXPathExpression()
Specified by:
getPackageXPathExpression in class AbstractXmlConfigurationArtifactAnalyzer

getNamespaceMapping

protected java.util.Map<java.lang.String,java.lang.String> getNamespaceMapping()
Specified by:
getNamespaceMapping in class AbstractXmlConfigurationArtifactAnalyzer