|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
com.agilejava.docbkx.maven.AbstractTransformerMojo
public abstract class AbstractTransformerMojo
The abstract Mojo base for concrete Mojos that generate some kind of output
format from DocBook. This Mojo will search documents in the directory
returned by getTargetDirectory()
, and apply the stylesheets on
these documents. This Mojo will be subclassed by Mojo's that generate a
particular type of output.
Field Summary |
---|
Fields inherited from interface org.apache.maven.plugin.Mojo |
---|
ROLE |
Constructor Summary | |
---|---|
AbstractTransformerMojo()
|
Method Summary | |
---|---|
void |
adjustTransformer(javax.xml.transform.Transformer transformer,
java.lang.String sourceFilename,
java.io.File targetFile)
The operation to override when it is required to make some adjustments to the Transformer right before it is applied to a certain source
file. |
protected abstract void |
configure(javax.xml.transform.Transformer transformer)
Configure the Transformer by passing in some parameters. |
protected org.apache.xml.resolver.CatalogManager |
createCatalogManager()
Creates a CatalogManager , used to resolve DTDs and other
entities. |
protected javax.xml.parsers.DocumentBuilder |
createDocumentBuilder()
Creates a DocumentBuilder to be used to parse DocBook XML
documents. |
protected org.jaxen.XPath |
createTitleXPath()
Creates an instance of an XPath expression for picking the title from a document. |
protected TransformerBuilder |
createTransformerBuilder(javax.xml.transform.URIResolver resolver)
Constructs the default TransformerBuilder . |
void |
execute()
Builds the actual output document. |
protected void |
executeTasks(org.apache.tools.ant.Target antTasks,
org.apache.maven.project.MavenProject mavenProject)
|
protected abstract java.util.List |
getArtifacts()
Returns the plugin dependencies. |
protected abstract java.lang.String |
getDefaultStylesheetLocation()
Returns the default stylesheet location within the root of the stylesheet distribution. |
protected java.net.URL |
getDefaultStylesheetURL()
Returns the URL of the default stylesheet. |
protected abstract java.util.List |
getEntities()
Returns a list of Entities |
protected abstract java.lang.String[] |
getIncludes()
Returns the include patterns, as a comma-seperate collection of patterns. |
protected abstract org.apache.maven.project.MavenProject |
getMavenProject()
Returns a reference to the current project. |
protected java.lang.String |
getNonDefaultStylesheetLocation()
The stylesheet location override by a class in the mojo hierarchy. |
protected java.net.URL |
getNonDefaultStylesheetURL()
Returns the URL of the default stylesheet. |
protected abstract org.apache.tools.ant.Target |
getPostProcess()
Returns the tasks that should be executed after the transformation. |
protected abstract org.apache.tools.ant.Target |
getPreProcess()
Returns the tasks that should be executed before the transformation. |
protected abstract java.io.File |
getSourceDirectory()
Returns the source directory containing the source XML files. |
protected abstract java.lang.String |
getStylesheetLocation()
Returns the actual stylesheet location. |
protected java.net.URL |
getStylesheetURL()
Returns the URL of the stylesheet. |
protected abstract java.io.File |
getTargetDirectory()
Returns the target directory in which all results should be placed. |
protected abstract java.lang.String |
getTargetFileExtension()
Returns the extension of the target files, e.g. |
protected abstract java.lang.String |
getType()
Returns the type of conversion. |
protected abstract boolean |
getXIncludeSupported()
Returns a boolean indicting if XInclude should be supported. |
void |
postProcess()
Alles classes to add their own specific post-processing logic. |
void |
postProcessResult(java.io.File result)
Post-processes the file. |
void |
preProcess()
Allows subclasses to add their own specific pre-processing logic. |
Methods inherited from class org.apache.maven.plugin.AbstractMojo |
---|
getLog, getPluginContext, setLog, setPluginContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractTransformerMojo()
Method Detail |
---|
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected abstract boolean getXIncludeSupported()
protected java.lang.String getNonDefaultStylesheetLocation()
null
.public void adjustTransformer(javax.xml.transform.Transformer transformer, java.lang.String sourceFilename, java.io.File targetFile)
Transformer
right before it is applied to a certain source
file. The two parameters provide some context, allowing implementers to
respond to specific conditions for specific files.
transformer
- The Transformer
that must be adjusted.sourceFilename
- The name of the source file that is being transformed.targetFile
- The target File.public void preProcess() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- If the Mojo fails to pre-process the results.public void postProcess() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- If the Mojo fails to post-process the results.public void postProcessResult(java.io.File result) throws org.apache.maven.plugin.MojoExecutionException
result
- An individual result.
org.apache.maven.plugin.MojoExecutionException
protected org.apache.xml.resolver.CatalogManager createCatalogManager()
CatalogManager
, used to resolve DTDs and other
entities.
CatalogManager
to be used for resolving DTDs and
other entities.protected javax.xml.parsers.DocumentBuilder createDocumentBuilder() throws org.apache.maven.plugin.MojoExecutionException
DocumentBuilder
to be used to parse DocBook XML
documents.
DocumentBuilder
instance.
org.apache.maven.plugin.MojoExecutionException
- If we cannot create an instance of the
DocumentBuilder
.protected org.jaxen.XPath createTitleXPath() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- If the XPath expression cannot be parsed.protected TransformerBuilder createTransformerBuilder(javax.xml.transform.URIResolver resolver)
TransformerBuilder
.
protected void executeTasks(org.apache.tools.ant.Target antTasks, org.apache.maven.project.MavenProject mavenProject) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected abstract void configure(javax.xml.transform.Transformer transformer)
transformer
- The Transformer that needs to be configured.protected abstract java.io.File getTargetDirectory()
protected abstract java.io.File getSourceDirectory()
protected abstract java.lang.String[] getIncludes()
protected java.net.URL getStylesheetURL()
getStylesheetLocation()
.
protected java.net.URL getNonDefaultStylesheetURL()
protected java.net.URL getDefaultStylesheetURL()
protected abstract java.lang.String getDefaultStylesheetLocation()
protected abstract java.lang.String getStylesheetLocation()
protected abstract java.lang.String getTargetFileExtension()
protected abstract java.util.List getEntities()
Entities
protected abstract org.apache.tools.ant.Target getPreProcess()
protected abstract org.apache.tools.ant.Target getPostProcess()
protected abstract org.apache.maven.project.MavenProject getMavenProject()
protected abstract java.util.List getArtifacts()
protected abstract java.lang.String getType()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |