org.openadaptor.doconverter
Class AbstractMetadataParser

java.lang.Object
  extended by org.openadaptor.doconverter.XMLReader
      extended by org.openadaptor.doconverter.AbstractMetadataParser
All Implemented Interfaces:
MetadataParser
Direct Known Subclasses:
NDCDMetadataParser, NullMetadataParser

public abstract class AbstractMetadataParser
extends XMLReader
implements MetadataParser

An abstract base class for metadata parsers. Provides some convenience methods for parsers; a getName() (you must provide a getVersion()) and static methods which provide a source of XML start and end tags for the metadata sections, etc.

Version:
1.0
Author:
Tim Bissell
See Also:
NDCDMetadataParser

Field Summary
protected  java.lang.String _NAME
          The (cached) MetadataParser name
(package private) static org.apache.log4j.Logger log
           
static java.lang.String TYPE_ATTR
          DataObject metadata type attribute name
static java.lang.String VERSION_ATTR
          DataObject metadata version attribute name
 
Constructor Summary
AbstractMetadataParser()
           
 
Method Summary
protected static XTag getMetadataEndTag()
          Returns the standard metadata end tag.
 java.lang.String getName()
          Returns a string representing the metadata parser name.
static XTag getNewMetadataStartTag()
          Returns a new Metadata version tag, for use by MetadataGenerators Returns an XTag representing - the caller can fill in the attribute values and write it to a stream
abstract  java.lang.String getVersion()
          Subclasses must return a version string here
 
Methods inherited from class org.openadaptor.doconverter.XMLReader
matchComment, matchEndTagNamed, matchTag, matchTagExactly, nextTag, nextXMLElement, xmlParsingFailed, xmlParsingFailed, xmlParsingFailedExpecting, xmlParsingFailedExpecting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openadaptor.doconverter.MetadataParser
canHandle, typesFromParser
 

Field Detail

log

static org.apache.log4j.Logger log

VERSION_ATTR

public static final java.lang.String VERSION_ATTR
DataObject metadata version attribute name

See Also:
Constant Field Values

TYPE_ATTR

public static final java.lang.String TYPE_ATTR
DataObject metadata type attribute name

See Also:
Constant Field Values

_NAME

protected java.lang.String _NAME
The (cached) MetadataParser name

Constructor Detail

AbstractMetadataParser

public AbstractMetadataParser()
Method Detail

getNewMetadataStartTag

public static XTag getNewMetadataStartTag()
Returns a new Metadata version tag, for use by MetadataGenerators Returns an XTag representing - the caller can fill in the attribute values and write it to a stream

Returns:
XTag metadata version tag

getMetadataEndTag

protected static XTag getMetadataEndTag()
Returns the standard metadata end tag. Currently . The user will not need to (must not!) alter this.


getName

public java.lang.String getName()
Returns a string representing the metadata parser name. If the class name if of the form XXXMetadataParser, returns XXX.

Specified by:
getName in interface MetadataParser
Returns:
parser name
See Also:
MetadataGenerator.getName()

getVersion

public abstract java.lang.String getVersion()
Subclasses must return a version string here

Specified by:
getVersion in interface MetadataParser
See Also:
MetadataGenerator.getVersion()