com.springsource.util.parser.manifest.internal
Class StandardVisitor

java.lang.Object
  extended by com.springsource.util.parser.manifest.internal.StandardVisitor
All Implemented Interfaces:
ManifestVisitor, ManifestContents

public class StandardVisitor
extends java.lang.Object
implements ManifestVisitor, ManifestContents

Concurrent Semantics
This class is thread safe.

Author:
Andy Clement

Field Summary
private  java.util.Map<java.lang.String,java.lang.String> currentAttributes
           
private  java.util.Map<java.lang.String,java.lang.String> mainAttributes
           
private  java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> otherSectionAttributes
           
private  java.util.List<java.lang.String> otherSectionNames
           
protected  boolean terminateAfterMainSection
           
private  java.lang.String version
           
 
Constructor Summary
StandardVisitor()
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getAttributesForSection(java.lang.String sectionName)
           
 java.util.Map<java.lang.String,java.lang.String> getMainAttributes()
           
 ManifestContents getManifestContents()
           
 java.util.List<java.lang.String> getSectionNames()
           
 java.lang.String getVersion()
           
 void setTerminateAfterMainSection(boolean b)
          Force the parsing to finish once the main section is completed (ignoring the rest of the data)
 void visitHeader(java.lang.String name, java.lang.String value)
           
 void visitManifestVersion(java.lang.String version)
           
 boolean visitSection(boolean isMain, java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

private java.lang.String version

mainAttributes

private java.util.Map<java.lang.String,java.lang.String> mainAttributes

otherSectionNames

private java.util.List<java.lang.String> otherSectionNames

otherSectionAttributes

private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> otherSectionAttributes

currentAttributes

private java.util.Map<java.lang.String,java.lang.String> currentAttributes

terminateAfterMainSection

protected boolean terminateAfterMainSection
Constructor Detail

StandardVisitor

public StandardVisitor()
Method Detail

visitManifestVersion

public void visitManifestVersion(java.lang.String version)
Specified by:
visitManifestVersion in interface ManifestVisitor

visitHeader

public void visitHeader(java.lang.String name,
                        java.lang.String value)
Specified by:
visitHeader in interface ManifestVisitor

getSectionNames

public java.util.List<java.lang.String> getSectionNames()
Specified by:
getSectionNames in interface ManifestVisitor
Specified by:
getSectionNames in interface ManifestContents
Returns:
the section names discovered during the visit

visitSection

public boolean visitSection(boolean isMain,
                            java.lang.String name)
Specified by:
visitSection in interface ManifestVisitor
Parameters:
isMain - or not
name - of section
Returns:
true if parsing should continue

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface ManifestVisitor
Specified by:
getVersion in interface ManifestContents
Returns:
the version number discovered during the visit

getMainAttributes

public java.util.Map<java.lang.String,java.lang.String> getMainAttributes()
Specified by:
getMainAttributes in interface ManifestVisitor
Specified by:
getMainAttributes in interface ManifestContents
Returns:
the main attributes discovered during the visit

getAttributesForSection

public java.util.Map<java.lang.String,java.lang.String> getAttributesForSection(java.lang.String sectionName)
Specified by:
getAttributesForSection in interface ManifestVisitor
Specified by:
getAttributesForSection in interface ManifestContents
Returns:
the attributes discovered for a particular section during the visit

setTerminateAfterMainSection

public void setTerminateAfterMainSection(boolean b)
Description copied from interface: ManifestVisitor
Force the parsing to finish once the main section is completed (ignoring the rest of the data)

Specified by:
setTerminateAfterMainSection in interface ManifestVisitor
Parameters:
b - true if parsing should finish after the main section is visited

getManifestContents

public ManifestContents getManifestContents()
Specified by:
getManifestContents in interface ManifestVisitor
Returns:
the contents of the manifested as constructed during the visit