com.phoenix_int.aserver.util.scriptwrapper.api
- InputFile
- OutputFile
- OutputFile2
- ParseableFile
- java.io.Closeable
- java.lang.AutoCloseable
Declaration
transferVar() function. Then, a mode can be passed in which specifies whether the function should read the template file, generate an input file, or parse an output file.
You will want to read the documentation on the fileWrapper utility for more specifics on how exactly the file parsing and options work.
Example usage from a java scriptwrapper (Comments show fileWrapper equivalents):
Nested Class Summary
Nested classes/interfaces inherited from interface com.phoenix_int.aserver.util.scriptwrapper.api.ParseableFile
ParseableFile.Mode
Field Summary
Fields inherited from class com.phoenix_int.aserver.util.scriptwrapper.api.AbstractFile
encoding, fileName, mode, parser, templateFileName, wrapper
Constructor Summary
Method Summary
Methods inherited from class com.phoenix_int.aserver.util.scriptwrapper.api.AbstractFile
actionByMode, backup, close, delete, getEncoding, getRealFile, readTemplate, setEncoding, setEncoding, setFileToGenerateOrParse, setTempEmbedded, setTemplateFile, setVariable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.phoenix_int.aserver.util.scriptwrapper.api.ParseableFile
backup, close, delete, readTemplate, setFileToGenerateOrParse, setTempEmbedded, setTemplateFile, setVariable
Field Detail
GENERATE
transferVar().
PARSE
fileToParse when transferVar() is called.
READ_TEMPLATE
transferVar() is called.
Constructor Detail
PHXRowFieldFile
wrapper- script-wrapper object
PHXRowFieldFile
PHXRowFieldFile
wrapper- The row field file will find files relative to the run directory specified in this wrapper object.mode- parser mode
PHXRowFieldFile
null instead.
Parameters:
baseDirectory- All files will be relative to this directorymode- parser mode
Method Detail
generate
generatein interfaceInputFile
java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionPHXNumberFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptioncom.phoenix_int.aserver.util.scriptwrapper.api.PHXRowFieldOutOfFileException
setFileToGenerate
setFileToGeneratein interfaceInputFile
fileName- file name
parse
parsein interfaceOutputFileparsein interfaceOutputFile2
java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionPHXNumberFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptioncom.phoenix_int.aserver.util.scriptwrapper.api.PHXRowFieldOutOfFileException
setFileToParse
setFileToParsein interfaceOutputFilesetFileToParsein interfaceOutputFile2
fileName- file name
newParser
newParserin classAbstractFile
rFile- The file to openpmode- caching mode for underlying parser
java.io.IOException
ensureFileParser
ensureFileParserin classAbstractFile
mode- parser mode in current context
java.io.IOException
defineSection
com.phoenix_int.aserver.util.PHXNoSuchBookmarkException
defineBookmark
defineVar
PHXNameAlreadyInUseExceptionPHXInvalidNameExceptionPHXInvalidTypeException
defineVar
PHXNameAlreadyInUseExceptionPHXInvalidNameExceptionPHXInvalidTypeException
defineVar
PHXNameAlreadyInUseExceptionPHXInvalidNameExceptionPHXInvalidTypeException
transferVars
transferVarsin classAbstractFile
java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionPHXNumberFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptioncom.phoenix_int.aserver.util.scriptwrapper.api.PHXRowFieldOutOfFileException
transferVar
var- The variable to read or writerow- The row in the file to read/write from/to.field- The field within the row to read/write from/to.
java.io.IOExceptionPHXNoSuchTokenExceptionPHXNumberFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptioncom.phoenix_int.aserver.util.scriptwrapper.api.PHXRowFieldOutOfFileException
transferVar
java.io.IOExceptionPHXNoSuchTokenExceptionPHXNumberFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptioncom.phoenix_int.aserver.util.scriptwrapper.api.PHXRowFieldOutOfFileException
transferVar
var- The variable to read or writerow- The row in the file to read/write from/to.field- The field within the row to read/write from/to.fformat- The fortran style format string to apply. Pass null for standard formatting.
java.io.IOExceptionPHXNoSuchTokenExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNumberFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptioncom.phoenix_int.aserver.util.scriptwrapper.api.PHXRowFieldOutOfFileException
transferVar
java.io.IOExceptionPHXNoSuchTokenExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNumberFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptioncom.phoenix_int.aserver.util.scriptwrapper.api.PHXRowFieldOutOfFileException
transferArray
var- The array to read or writerowstart- The starting row in the file to read/write from/torowend- The ending row in the file to read/write from/tofieldstart- The starting field within the row to read/write from/tofieldend- The ending field within the row to read/write from/to
java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionPHXNumberFormatException
transferArray
var- The array to read or writerowstart- The starting row in the file to read/write from/torowend- The ending row in the file to read/write from/tofieldstart- The starting field within the row to read/write from/tofieldend- The ending field within the row to read/write from/tonumDimensions- Either 1 or 2 to read/write 1 or 2-d arrays.
java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionPHXNumberFormatException
transferArray
var- The array to read or writerowstart- The starting row in the file to read/write from/torowend- The ending row in the file to read/write from/tofieldstart- The starting field within the row to read/write from/tofieldend- The ending field within the row to read/write from/toresizable- Whether or not the array is resizable when using ParseableFile.Mode.GENERATE.fformat- The fortran style format string to apply. Pass null for standard formatting.
java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionPHXNumberFormatException
transferArray
var- The array to read or writerowstart- The starting row in the file to read/write from/torowend- The ending row in the file to read/write from/tofieldstart- The starting field within the row to read/write from/tofieldend- The ending field within the row to read/write from/toresizable- Whether or not the array is resizable when using ParseableFile.Mode.GENERATE.fformat- The fortran style format string to apply. Pass null for standard formatting.numDimensions- The number of dimensions to read the array as. Must be 1 or 2.
java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionPHXNumberFormatException
transferKeyVar
var- The variable to read or writekey- The string to search for that identifies the variable in the file.
java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionPHXNumberFormatException
transferKeyVar
var- The variable to read or writekey- The string to search for that identifies the variable in the file.occurrence- (default 1). Which occurrence of string to find.rowOffset- (default 0). Once the string is found, offset by this many rowsfield- (default 1). Once the string is found, offset by this many fields. If a negative number is used, it will count from the end of the row backwards, but will not count past the key variable.fformat- The fortran style format string to apply. Pass null for standard formatting.
java.io.IOExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXNoSuchTokenExceptionPHXNumberFormatException
readValue
row- The row of the file to read fromfield- The field of the file to read from.
java.lang.IllegalArgumentException- This function does not work ifsetDelimiters("columns")has been specified.java.io.IOExceptionPHXNoSuchTokenExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptioncom.phoenix_int.aserver.util.scriptwrapper.api.PHXRowFieldOutOfFileException
readLong
row- The row of the file to read fromfield- The field of the file to read from.
java.lang.IllegalArgumentException- This function does not work ifsetDelimiters("columns")has been specified.java.io.IOExceptionPHXNoSuchTokenExceptionjava.lang.NumberFormatExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptioncom.phoenix_int.aserver.util.scriptwrapper.api.PHXRowFieldOutOfFileException
readDouble
row- The row of the file to read fromfield- The field of the file to read from.
java.lang.IllegalArgumentException- This function does not work ifsetDelimiters("columns")has been specified.java.io.IOExceptionPHXNoSuchTokenExceptionjava.lang.NumberFormatExceptioncom.phoenix_int.aserver.util.PHXInvalidFormatExceptionPHXBookmarkNotFoundExceptionPHXSectionNotFoundExceptioncom.phoenix_int.aserver.util.scriptwrapper.api.PHXRowFieldOutOfFileException
writeValue
row- The row of the file to read fromfield- The field of the file to read from.val- The string to write
java.lang.IllegalArgumentException- This function does not work ifsetDelimiters("columns")has been specified.java.io.IOExceptionPHXNoSuchTokenException
setDelimiters
- “columns” - Fortran style column based fields.
- null - default delimiters (whitespace)
- “whitespace” - default delimiters (whitespace)
- “default” - default delimiters (whitespace)
- "" - default delimiters (whitespace)
- “none” - No delimiters (entire line as single field)
- Any other string is taken as a list of character delimiters
java.io.IOException
setDecimalSeparator
separator- character to be used as a decimal separator
clearMarks
markAsBeginning() or markAsEnd() calls
Throws:
java.io.IOException
markAsBeginning
markAsBeginning or clearMarks call.
Throws:
java.io.IOExceptionPHXNoSuchTokenException
markAsBeginning
markAsBeginning or clearMarks call.
Parameters:
find- The string to search for.occurrence- Search for the Nth occurrence of string (default 1)offset- After finding string, move down offset rows. May be negative to move up. (default 0)regex- Iftrue, the find parameter is a regular expression. (defaultfalse)
java.io.IOExceptionPHXNoSuchTokenException
markAsBeginning
markAsBeginning or clearMarks call.
Parameters:
row- The row to set
java.io.IOExceptionPHXNoSuchTokenException
markAsEnd
markAsEnd or clearMarks call.
Parameters:
find- The string to search for.
java.io.IOExceptionPHXNoSuchTokenException
markAsEnd
markAsEnd or clearMarks call.
Parameters:
find- The string to search for.occurrence- Search for the Nth occurrence of string (default 1)offset- After finding string, move down offset rows. May be negative to move up. (default 0)regex- Iftrue, the find parameter is a regular expression. (defaultfalse)
java.io.IOExceptionPHXNoSuchTokenException
markAsEnd
markAsBeginning or clearMarks call.
Parameters:
row- The row to set
java.io.IOExceptionPHXNoSuchTokenException