de.smartics.maven.util.report.link
Class AbstractLinkConstructorStrategy

Package class diagram package AbstractLinkConstructorStrategy
java.lang.Object
  extended by de.smartics.maven.util.report.link.AbstractLinkConstructorStrategy
All Implemented Interfaces:
LinkConstructorStrategy
Direct Known Subclasses:
DirectoryPathLinkConstructorStrategy, FilePathLinkConstructorStrategy, SingleDocumentLinkConstructorStrategy

public abstract class AbstractLinkConstructorStrategy
     
     
extends Object
implements LinkConstructorStrategy

Base implementation of the LinkConstructorStrategy interface.


Field Summary
protected  LinkConstructorStrategyConfig config
          The configuration of this strategy instance.
 
Constructor Summary
protected AbstractLinkConstructorStrategy(LinkConstructorStrategyConfig config)
          Default constructor.
 
Method Summary
protected abstract  void addPackagePart(StringBuilder buffer, String packageName)
          Adds the package part of the link.
protected  void addQualifiedType(StringBuilder buffer, JavaElementRef ref)
           
protected  void appendBasePathSeparator(StringBuilder buffer)
          Appends the separator between the base path and the package part.
protected  void appendMemberPart(StringBuilder buffer, de.smartics.util.source.MethodInfo method)
          Adds the member part of the link if the configuration requires the member part to be rendered.
protected  void appendTypePart(StringBuilder buffer, String typeName)
          Adds the type part of the link.
protected  void constructFilePath(StringBuilder buffer, JavaElementRef ref)
           
 String constructLink(String baseLink, JavaElementRef ref)
          Constructs a path to the specified Java element.
 LinkConstructorStrategyConfig getConfig()
          Returns the configuration of this strategy instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected final LinkConstructorStrategyConfig config
The configuration of this strategy instance.

Constructor Detail

AbstractLinkConstructorStrategy

protected AbstractLinkConstructorStrategy(LinkConstructorStrategyConfig config)
                                   throws org.apache.commons.lang.NullArgumentException
Default constructor.

Parameters:
config - the configuration of this strategy instance.
Throws:
org.apache.commons.lang.NullArgumentException - if config is null.
Method Detail

getConfig

public LinkConstructorStrategyConfig getConfig()
Returns the configuration of this strategy instance.

Specified by:
getConfig in interface LinkConstructorStrategy
Returns:
the configuration of this strategy instance.

constructLink

public String constructLink(String baseLink,
                            JavaElementRef ref)
Constructs a path to the specified Java element.

Specified by:
constructLink in interface LinkConstructorStrategy
Parameters:
baseLink - the base link to prepend.
ref - the element in the report to reference.
Returns:
the path to the element or null if the referenced element does not exit (only the existence of the file is checked, not the element within the file).

constructFilePath

protected void constructFilePath(StringBuilder buffer,
                                 JavaElementRef ref)

addQualifiedType

protected void addQualifiedType(StringBuilder buffer,
                                JavaElementRef ref)

appendBasePathSeparator

protected void appendBasePathSeparator(StringBuilder buffer)
Appends the separator between the base path and the package part.

Implementation Notes:
Appends a single slash.
Parameters:
buffer - the buffer to append to.

addPackagePart

protected abstract void addPackagePart(StringBuilder buffer,
                                       String packageName)
Adds the package part of the link.

Parameters:
buffer - the buffer to append to.
packageName - the name of the package to render.

appendTypePart

protected void appendTypePart(StringBuilder buffer,
                              String typeName)
Adds the type part of the link.

Implementation Notes:
The default implementation adds the extension separated by a dot.
Parameters:
buffer - the buffer to append to.
typeName - the name of the package to render.

appendMemberPart

protected void appendMemberPart(StringBuilder buffer,
                                de.smartics.util.source.MethodInfo method)
Adds the member part of the link if the configuration requires the member part to be rendered.

Parameters:
buffer - the buffer to append to.
method - the name of the member to render.


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