|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.phoenix_int.aserver.util.scriptwrapper.api.AbstractFile
public abstract class AbstractFile
Common implementation for files (not file variables) used in script wrappers.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.phoenix_int.aserver.util.scriptwrapper.api.ParseableFile |
|---|
ParseableFile.Mode |
| Field Summary | |
|---|---|
protected com.phoenix_int.util.PHXFileUtils.Encoding |
encoding |
protected java.lang.String |
fileName |
protected ParseableFile.Mode |
mode |
protected Parser |
parser |
protected java.lang.String |
templateFileName |
protected PHXScriptWrapperObject |
wrapper |
| Constructor Summary | |
|---|---|
protected |
AbstractFile(java.io.File baseDir, ParseableFile.Mode mode)Pre-QuickWrap PHXRowFieldFile constructor did not have a PHXScriptWrapperObject argument. |
protected |
AbstractFile(PHXScriptWrapperObject wrapper, java.io.File dir, ParseableFile.Mode mode) |
protected |
AbstractFile(PHXScriptWrapperObject wrapper, ParseableFile.Mode mode) |
| Method Summary | |
|---|---|
protected void |
actionByMode(ParseableFile.Mode mode)Perform an action consistent with ParseableFile.Mode |
void |
backup()Backup the file on disk. |
void |
close()Close the file and free up resources |
void |
delete()Delete the file from disk. |
protected void |
ensureFileParser(ParseableFile.Mode mode)Ensure there is a valid parser |
com.phoenix_int.util.PHXFileUtils.Encoding |
getEncoding() |
protected java.io.File |
getRealFile(java.lang.String fileName)Get the file on disk, possibly relative to the current run-share directory |
protected abstract Parser |
newParser(java.io.File rFile, Parser.Mode pmode)Generate a new parser for the given file and mode |
void |
readTemplate()Read the template |
void |
setEncoding(com.phoenix_int.util.PHXFileUtils.Encoding enc) |
void |
setEncoding(java.lang.String enc) |
void |
setFileToGenerateOrParse(java.lang.String fileName)Set the file to generate or to parse, depending on the mode |
void |
setTempEmbedded(java.lang.String option)This method applies only to ModelCenter and has no function in Analysis Server |
void |
setTemplateFile(java.lang.String templateFileName)Set the template file to read. |
void |
setVariable(java.lang.String name, java.lang.String value)Sets the value of a variable |
protected abstract void |
transferVars(ParseableFile.Mode mode)Transfer values for variables that have been defined using methods from the concrete implementation, i.e. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final ParseableFile.Mode mode
protected final PHXScriptWrapperObject wrapper
protected Parser parser
protected java.lang.String templateFileName
protected java.lang.String fileName
protected com.phoenix_int.util.PHXFileUtils.Encoding encoding
| Constructor Detail |
|---|
protected AbstractFile(java.io.File baseDir,
ParseableFile.Mode mode)
PHXRowFieldFile constructor did not have a PHXScriptWrapperObject argument. This constructor handles the legacy case, which, in all likelihood, will continue to be used
baseDir - base directory containing template files, etc.mode - parsing mode
protected AbstractFile(PHXScriptWrapperObject wrapper,
ParseableFile.Mode mode)
protected AbstractFile(PHXScriptWrapperObject wrapper,
java.io.File dir,
ParseableFile.Mode mode)
wrapper - may be null for legacy constructor compatibilitydir -mode -| Method Detail |
|---|
public void backup()
backup in interface ParseableFilepublic void close()
close in interface ParseableFileclose in interface java.io.Closeablepublic void delete()
delete in interface ParseableFile
protected abstract Parser newParser(java.io.File rFile,
Parser.Mode pmode)
throws java.io.IOException
rFile - The file to openpmode - caching mode for underlying parserjava.io.IOException
protected void ensureFileParser(ParseableFile.Mode mode)
throws java.io.IOException
mode - parser mode in current contextjava.io.IOExceptionpublic com.phoenix_int.util.PHXFileUtils.Encoding getEncoding()
public void setEncoding(com.phoenix_int.util.PHXFileUtils.Encoding enc)
public void setEncoding(java.lang.String enc)
protected java.io.File getRealFile(java.lang.String fileName)
fileName -
protected void actionByMode(ParseableFile.Mode mode)
throws java.io.IOException,
com.phoenix_int.aserver.util.PHXInvalidFormatException,
PHXNoSuchTokenException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
PHXNumberFormatException,
PHXBookmarkNotFoundException,
PHXSectionNotFoundException
ParseableFile.Mode
mode -java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionPHXNumberFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundException
public void readTemplate()
throws java.io.IOException,
com.phoenix_int.aserver.util.PHXInvalidFormatException,
PHXNoSuchTokenException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
PHXNumberFormatException,
PHXBookmarkNotFoundException,
PHXSectionNotFoundException
readTemplate in interface ParseableFilejava.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionPHXNumberFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptionpublic void setFileToGenerateOrParse(java.lang.String fileName)
setFileToGenerateOrParse in interface ParseableFilepublic void setTempEmbedded(java.lang.String option)
setTempEmbedded in interface ParseableFilepublic void setTemplateFile(java.lang.String templateFileName)
setTemplateFile in interface ParseableFiletemplateFileName - file name
public void setVariable(java.lang.String name,
java.lang.String value)
throws PHXNoSuchObjectException
setVariable in interface ParseableFilename - variable namevalue - variable value as a stringPHXNoSuchObjectException
protected abstract void transferVars(ParseableFile.Mode mode)
throws java.io.IOException,
com.phoenix_int.aserver.util.PHXInvalidFormatException,
PHXNoSuchTokenException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
PHXNumberFormatException,
PHXBookmarkNotFoundException,
PHXSectionNotFoundException
PHXRowFieldFile.defineVar(String, String, boolean, String)
Variables defined using PHXScriptWrapperObject.addVariable(String, String, boolean) must be explicitly transferred using methods of the concrete implementation class
mode -java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionPHXNumberFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||