org.jostraca
Class VirtualTemplatePath

java.lang.Object
  extended byorg.jostraca.VirtualTemplatePath
All Implemented Interfaces:
TemplatePath

public class VirtualTemplatePath
extends java.lang.Object
implements TemplatePath

The Service class assumes a file based template model, and expects each template to have a file path. Virtual templates thus have virtual paths to fulfill that requirement. REVIEW: which indicates that the model needs changing, hmm?


Field Summary
static java.lang.String CN
           
 
Fields inherited from interface org.jostraca.TemplatePath
STANDARD_LIBRARY_SEPARATOR, STANDARD_TEMPLATE_EXTENSION
 
Constructor Summary
VirtualTemplatePath(java.lang.String pTemplateName)
          Calls #setTemplateName().
VirtualTemplatePath(java.lang.String pTemplateName, java.io.File pTemplatePath)
          Calls #setTemplateName(), also sets path.
VirtualTemplatePath(java.lang.String pTemplateName, java.lang.String pTemplateListFile)
           
 
Method Summary
 boolean equals(java.lang.Object pObject)
          Equality depends on TemplateName
 java.lang.String getTemplateFileName()
          Get template file name.
 java.lang.String getTemplateFolder()
          Get folder of template file.
 java.lang.String getTemplateListFile()
          Get name of template list file as specified.
 java.lang.String getTemplateName()
          Get name of template file as specified.
 java.lang.String getTemplatePath()
          Get path of template file.
 int hashCode()
          For Hashtables
 boolean isLibraryTemplate()
          Is a library template file.
 void resolve(java.lang.String[] pTemplatePaths)
          Resolve template name to a file path.
 PropertySet resolvePropertySet()
          Load PropertySet associated with the template path.
 void setPropertySet(PropertySet pPropertySet)
          Set template path property set dynamically
 void setTemplateName(java.lang.String pTemplateName)
          Set the name of the template to generate.
 void setTemplateNameFromFile(java.lang.String pTemplateName, java.lang.String pTemplateListFile)
          Set the name of the template and file path of the template list file which contained the template name.
 java.lang.String toString()
          Path to template file.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CN

public static final java.lang.String CN
Constructor Detail

VirtualTemplatePath

public VirtualTemplatePath(java.lang.String pTemplateName)
Calls #setTemplateName().


VirtualTemplatePath

public VirtualTemplatePath(java.lang.String pTemplateName,
                           java.io.File pTemplatePath)
Calls #setTemplateName(), also sets path. REVIEW: why is this needed for virtual paths?


VirtualTemplatePath

public VirtualTemplatePath(java.lang.String pTemplateName,
                           java.lang.String pTemplateListFile)
See Also:
TemplatePath
Method Detail

setTemplateName

public void setTemplateName(java.lang.String pTemplateName)
Description copied from interface: TemplatePath
Set the name of the template to generate. This can be: 1. A relative file path (to the current folder) 2. An absolute file path

Specified by:
setTemplateName in interface TemplatePath
Parameters:
pTemplateName - Name of template.
See Also:
TemplatePath

setTemplateNameFromFile

public void setTemplateNameFromFile(java.lang.String pTemplateName,
                                    java.lang.String pTemplateListFile)
Description copied from interface: TemplatePath
Set the name of the template and file path of the template list file which contained the template name. Template names in a template list file are considered to be relative file paths (to the folder containing the template list file) unless they are explicity absolute.

Specified by:
setTemplateNameFromFile in interface TemplatePath
Parameters:
pTemplateListFile - Template list file specified with '-t'
See Also:
TemplatePath

resolve

public void resolve(java.lang.String[] pTemplatePaths)
Description copied from interface: TemplatePath
Resolve template name to a file path. If template name ends in .jtm then search for file first else search for library template using path list from main.TemplatePath. Vice Versa if template name does not end in .jtm.

Specified by:
resolve in interface TemplatePath
Parameters:
pTemplatePaths - Search paths for templates.
See Also:
TemplatePath

getTemplatePath

public java.lang.String getTemplatePath()
Description copied from interface: TemplatePath
Get path of template file.

Specified by:
getTemplatePath in interface TemplatePath
See Also:
TemplatePath

getTemplateFolder

public java.lang.String getTemplateFolder()
Description copied from interface: TemplatePath
Get folder of template file.

Specified by:
getTemplateFolder in interface TemplatePath
See Also:
TemplatePath

getTemplateFileName

public java.lang.String getTemplateFileName()
Description copied from interface: TemplatePath
Get template file name.

Specified by:
getTemplateFileName in interface TemplatePath
See Also:
TemplatePath

getTemplateName

public java.lang.String getTemplateName()
Description copied from interface: TemplatePath
Get name of template file as specified.

Specified by:
getTemplateName in interface TemplatePath
See Also:
TemplatePath

getTemplateListFile

public java.lang.String getTemplateListFile()
Description copied from interface: TemplatePath
Get name of template list file as specified.

Specified by:
getTemplateListFile in interface TemplatePath
See Also:
TemplatePath

isLibraryTemplate

public boolean isLibraryTemplate()
Description copied from interface: TemplatePath
Is a library template file.

Specified by:
isLibraryTemplate in interface TemplatePath
See Also:
TemplatePath

resolvePropertySet

public PropertySet resolvePropertySet()
Description copied from interface: TemplatePath
Load PropertySet associated with the template path. May be a properties file or could be set dynamically.

Specified by:
resolvePropertySet in interface TemplatePath
See Also:
TemplatePath

setPropertySet

public void setPropertySet(PropertySet pPropertySet)
Set template path property set dynamically


toString

public java.lang.String toString()
Description copied from interface: TemplatePath
Path to template file.

Specified by:
toString in interface TemplatePath
See Also:
TemplatePath

equals

public boolean equals(java.lang.Object pObject)
Description copied from interface: TemplatePath
Equality depends on TemplateName

Specified by:
equals in interface TemplatePath
See Also:
TemplatePath

hashCode

public int hashCode()
Description copied from interface: TemplatePath
For Hashtables

Specified by:
hashCode in interface TemplatePath
See Also:
TemplatePath


Copyright © 2000-2002 Richard Rodger