com.springsource.util.osgi.manifest.parse.standard
Interface HeaderVisitor

All Known Implementing Classes:
DebugVisitor, MultiplexingVisitor, StandardHeaderVisitor

public interface HeaderVisitor

HeaderDeclarations are constructed through a visitor pattern. As the parser processes data it calls methods on the visitor interface. The standard implementation is StandardHeaderVisitor but other visitors can be plugged in. For example, the DebugVisitor produces diagnostics about the visiting process. A validation visitor could be plugged in to verify package names or attribute names and values. Concurrent Semantics
Threadsafe.

Author:
Andy Clement

Method Summary
 void clauseEnded()
          Called when a clause ends.
 void endvisit()
          Called when the end of the input has been reached.
 HeaderDeclaration getFirstHeaderDeclaration()
           
 java.util.List<HeaderDeclaration> getHeaderDeclarations()
           
 void initialize()
          Called ahead of parsing a new header
 void visitAttribute(java.lang.String name, java.lang.String value)
          Visit a new attribute (parsed from input of the form name=value)
 void visitDirective(java.lang.String name, java.lang.String value)
          Visit a new directive (parsed from input of the form name:=value)
 void visitSymbolicName(java.lang.String name)
          Called to visit a symbolic name.
 void visitUniqueName(java.lang.String name)
          Called to visit a unique name.
 void visitWildcardName(java.lang.String name)
          Called to visit a wildcard name.
 

Method Detail

visitDirective

void visitDirective(java.lang.String name,
                    java.lang.String value)
Visit a new directive (parsed from input of the form name:=value)

Parameters:
name -
value -

visitAttribute

void visitAttribute(java.lang.String name,
                    java.lang.String value)
Visit a new attribute (parsed from input of the form name=value)

Parameters:
name -
value -

getHeaderDeclarations

java.util.List<HeaderDeclaration> getHeaderDeclarations()
Returns:
a list of all HeaderDeclarations if this visitor has been collecting the information. Empty list if nothing has been collected

getFirstHeaderDeclaration

HeaderDeclaration getFirstHeaderDeclaration()
Returns:
the first (and probably only) HeaderDeclaration, otherwise null

clauseEnded

void clauseEnded()
Called when a clause ends. Clauses are comma separated: header=clause (',' clause)*. It is a sign that a new clause is about to start.


visitSymbolicName

void visitSymbolicName(java.lang.String name)
Called to visit a symbolic name. These are of the form: "symbolic-name :: = token('.'token)*". So basically a sequence of dot separated tokens.

Parameters:
name -

visitUniqueName

void visitUniqueName(java.lang.String name)
Called to visit a unique name. These are of the form: "unique-name :: = identifier('.'identifier)*". So basically a sequence of dot separated identifiers..

Parameters:
name -

visitWildcardName

void visitWildcardName(java.lang.String name)
Called to visit a wildcard name. These are similar to a unique name but wildcards are permitted. These are valid wildcarded names: '*' or 'com.foo.*' or 'com.foo.goo'.

Parameters:
name -

endvisit

void endvisit()
Called when the end of the input has been reached.


initialize

void initialize()
Called ahead of parsing a new header