de.smartics.properties.spi.core.metadata.projectdoc
Class ProjectdocMetaDataParser

Package class diagram package ProjectdocMetaDataParser
java.lang.Object
  extended by de.smartics.properties.spi.core.metadata.projectdoc.ProjectdocMetaDataParser
Direct Known Subclasses:
PropertyProjectdocParser, PropertySetProjectdocParser

public abstract class ProjectdocMetaDataParser
     
     
extends Object

Parses projectdoc information from property XML descriptors.


Nested Class Summary
 class ProjectdocMetaDataParser.ParserContext
          Provide access to information relevant for parsing and storing the parsed information.
 
Field Summary
protected  PropertiesContext context
          The properties context to fetch information from the META-INF folder.
protected  ProjectdocAnnotationCollector.Defaults defaults
          The metadata defaults to use.
 
Constructor Summary
protected ProjectdocMetaDataParser(PropertiesContext context)
          Convenience constructor without defaults.
protected ProjectdocMetaDataParser(PropertiesContext context, ProjectdocAnnotationCollector.Defaults defaults)
          Default constructor.
 
Method Summary
protected abstract  String calcPath(PropertyDescriptor descriptor, Locale locale)
          Calculates the path to a resource to be parsed.
protected abstract  org.jdom.Namespace getNs()
          Returns the namespace of the elements parsed by this parser.
 ProjectdocMetaData parse(PropertyDescriptor descriptor, Locale locale)
          Parses the comments for the given descriptor.
protected  void parseAdditional(ProjectdocMetaDataParser.ParserContext context)
          The hook that allows to add further information.
protected  void parseBase(PropertyDescriptor descriptor, Locale locale, ProjectdocMetaData metaData)
          Parses the comments for the given descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected final PropertiesContext context
The properties context to fetch information from the META-INF folder.


defaults

protected final ProjectdocAnnotationCollector.Defaults defaults
The metadata defaults to use.

Constructor Detail

ProjectdocMetaDataParser

protected ProjectdocMetaDataParser(PropertiesContext context)
                            throws NullPointerException
Convenience constructor without defaults.

Parameters:
context - the properties context to fetch information from the META-INF folder.
Throws:
NullPointerException - if context is null.

ProjectdocMetaDataParser

protected ProjectdocMetaDataParser(PropertiesContext context,
                                   ProjectdocAnnotationCollector.Defaults defaults)
                            throws NullPointerException
Default constructor.

Parameters:
context - the properties context to fetch information from the META-INF folder.
defaults - the metadata defaults to use.
Throws:
NullPointerException - if context is null.
Method Detail

parse

@CheckForNull
public ProjectdocMetaData parse(PropertyDescriptor descriptor,
                                             Locale locale)
Parses the comments for the given descriptor.

This method is overridden by subclasses to return their specific implementation of the DocumentMetaData.

Parameters:
descriptor - the descriptor whose comments are requested to be parsed.
locale - the locale to select the comments.
Returns:
the comments for the given locale or the default comments, if the locale is not supported. May be null if no information is provided.

parseBase

protected final void parseBase(PropertyDescriptor descriptor,
                               Locale locale,
                               ProjectdocMetaData metaData)
                        throws MetaDataException
Parses the comments for the given descriptor.

Parameters:
descriptor - the descriptor whose comments are requested to be parsed.
locale - the locale to select the comments.
metaData - the container where the parsed information is put to.
Throws:
MetaDataException - if the meta data cannot be read.

calcPath

protected abstract String calcPath(PropertyDescriptor descriptor,
                                   Locale locale)
Calculates the path to a resource to be parsed.

Parameters:
descriptor - the descriptor to the resource.
locale - the requested locale.
Returns:
the path to the resource.

parseAdditional

protected void parseAdditional(ProjectdocMetaDataParser.ParserContext context)
                        throws MetaDataException
The hook that allows to add further information.

Parameters:
context - to provide access to information relevant for parsing and storing the parsed information.
Throws:
MetaDataException - if the meta data cannot be read.

getNs

protected abstract org.jdom.Namespace getNs()
Returns the namespace of the elements parsed by this parser.

Returns:
the namespace of the elements parsed by this parser.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.