|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gate.yam.YamFile
public class YamFile
Main interface to the YAM language and its translation. Target languages:
Nested Class Summary | |
---|---|
static class |
YamFile.FileType
The various file types involved with YAM and their filename suffixes. |
Method Summary | |
---|---|
YamParseTree |
generate()
Translate to target languages. |
void |
generateType(YamFile.FileType type)
Trigger generation of the various output types. |
static YamFile |
get(File location)
Static factory method for getting a YAM file. |
static YamFile |
get(org.springframework.core.io.FileSystemResource location)
Static factory method for getting a YAM file. |
String |
getCanonicalPath()
Giveas the canonical path of this YamFile |
File |
getHtmlFile()
Get the File for HTML output. |
String |
getHtmlPath()
Get the path for an HTML output file. |
List<String> |
getIncludes()
Get the list of includes from this YAM file to other local files, as a list of canonical paths of those files. |
List<String> |
getLinks()
Get the list of links from this YAM file to other local files, as a list of canonical paths of those files. |
org.springframework.core.io.FileSystemResource |
getLocation()
Get the location of this file. |
File |
getOutputFile(YamFile.FileType type)
Create a file of a particular output type. |
List<String> |
getOutputLocations()
Get a List of those output file locations that are generated by this YamFile. |
YamParseTree |
getParseTree()
Get the parse tree (and related state) created by generate() . |
static String |
getPluginPackageName()
Get the package name for YAM plugins. |
String |
getVersion()
Get the language version number. |
static YamFile |
needsGeneration(org.springframework.core.io.FileSystemResource location)
This method checks whether a dependent file (one that is generated from YAM) needs regeneration, and if so it returns a YamFile instance corresponding to the generated file. |
static String |
printErrors(YamParseTree parseTree)
Print errors and warnings from parsing. |
void |
replaceInContext(String name)
Reset the location of this YamFile in the directory pointed to by the context path. |
void |
setBibAnchorPrefix(String bibAnchorPrefix)
Set the prefix added to citation keys, when forming a reference to a bibiography file entry |
void |
setBibPageUrl(org.springframework.core.io.UrlResource bibPageUrl)
Set the URL within which citation keys will be resolved. |
void |
setContextPath(String contextPath)
Set the path in which to check for existence of relative links. |
void |
setCreatePageUrl(String createPageUrl)
Set the URL which non-existent links will be pointed at (which presumably is the "create new page" URL for the parent wiki). |
void |
setCreatePageUrl(org.springframework.core.io.UrlResource createPageUrl)
Set the URL which non-existent links will be pointed at (which presumably is the "create new page" URL for the parent wiki). |
void |
setDoIncludes(boolean b)
Should we process included files or not? |
String |
toString()
Return a String representing this YamFile: the String representation of the underlying File. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public org.springframework.core.io.FileSystemResource getLocation()
public String getCanonicalPath() throws gate.util.GateException
gate.util.GateException
- If the canonical path of this YamFile causes an
IOExceptionpublic static YamFile get(File location)
get(FileSystemResource)
.
public static YamFile get(org.springframework.core.io.FileSystemResource location)
location
- a path that points to a YAM file or a file depending on a
YAM file.
public void setContextPath(String contextPath)
contextPath
- the path to search in.public void replaceInContext(String name)
name
- the file name of thepublic void setCreatePageUrl(String createPageUrl)
createPageUrl
- the link to point to.public void setCreatePageUrl(org.springframework.core.io.UrlResource createPageUrl)
createPageUrl
- the link to point to.public void setBibPageUrl(org.springframework.core.io.UrlResource bibPageUrl)
setBibAnchorPrefix
method
bibPageUrl
- the URL of the bibliogrpahy.public void setBibAnchorPrefix(String bibAnchorPrefix)
bibAnchorPrefix
- The prefix added to citation keys.setBibPageUrl(UrlResource)
public File getOutputFile(YamFile.FileType type)
public File getHtmlFile()
public String getHtmlPath()
public void generateType(YamFile.FileType type)
public List<String> getOutputLocations() throws gate.util.GateException
gate.util.GateException
- if there is an exception on the YamFile location.public static YamFile needsGeneration(org.springframework.core.io.FileSystemResource location) throws gate.util.GateRuntimeException
location
- a file that may be generated from a YAM source file
gate.util.GateRuntimeException
- if we get an IO exception on the location
filepublic YamParseTree getParseTree()
generate()
.
If generate hasn't been run this will be null.
public void setDoIncludes(boolean b)
public YamParseTree generate() throws gate.util.GateException
gate.util.GateException
- if parsing or translation fails.public List<String> getLinks()
public List<String> getIncludes()
public String getVersion()
public static final String getPluginPackageName()
public String toString()
toString
in class Object
public static String printErrors(YamParseTree parseTree)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |