net.larsan.urd.ant.website
Class DocBody

java.lang.Object
  |
  +--net.larsan.urd.ant.website.DocBody
All Implemented Interfaces:
Substitution
Direct Known Subclasses:
XMLBody

public class DocBody
extends java.lang.Object
implements Substitution

A document body is an document that gets iserted into a template. The base class is a straight substitution for the "##DOC-BODY##". Subclasses of this class may take XML documents and apply transformations.

This class follows the rule of a substitution and can optionally be labeled differently than the default "##DOC-BODY##"

Version:
Alpha-0.1 / 2002-10-06 21:37
Author:
Lars J. Nilsson
See Also:
Compiler

Field Summary
static java.lang.String DEFAULT_LABEL
          Default body label for template substitutions
protected  java.io.File document
           
protected  java.lang.String label
           
 
Constructor Summary
DocBody(java.io.File document)
           
 
Method Summary
 java.lang.String getBody()
          Get the document as a string
protected  java.lang.String readDocument()
          Read document, xml documents should override this method to perform a transformation before returning
protected  void setLabel(java.lang.String label)
          Set sunstitution label
 java.lang.String substitute(java.lang.String source)
          Subsitute into source according to the current label
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LABEL

public static final java.lang.String DEFAULT_LABEL
Default body label for template substitutions

See Also:
Constant Field Values

document

protected java.io.File document

label

protected java.lang.String label
Constructor Detail

DocBody

public DocBody(java.io.File document)
Parameters:
document - Document to insert
Method Detail

substitute

public java.lang.String substitute(java.lang.String source)
                            throws CompilerException
Subsitute into source according to the current label

Specified by:
substitute in interface Substitution
CompilerException

getBody

public java.lang.String getBody()
                         throws CompilerException
Get the document as a string

CompilerException

readDocument

protected java.lang.String readDocument()
                                 throws CompilerException
Read document, xml documents should override this method to perform a transformation before returning

CompilerException

setLabel

protected void setLabel(java.lang.String label)
Set sunstitution label