|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--uk.org.ogsadai.client.toolkit.activity.RequestComponent
|
+--uk.org.ogsadai.client.toolkit.activity.Activity
|
+--uk.org.ogsadai.client.toolkit.activity.files.FileWriting
An OGSA-DAI file writing activity. This class is the superclass of all
activities which use OGSA-DAI's fileWritingActivity activity.
| Field Summary | |
static int |
APPEND
Indicates an append action. |
static int |
BOF
An offset denoting the beginning of the file or a line. |
static int |
DELETE
Indicates a delete action. |
static int |
EOF
An offset denoting the end of the file or a file. |
static int |
INSERT
Indicates an insert action. |
protected int |
mAction
The particular kind of file writing that will take place. |
protected java.lang.String |
mFilename
The filename of the file to write to. |
protected int |
mLength
The number of bytes length over which the writing will occur. |
protected java.lang.String |
mMatch
An expression of the instances of matches of the regular expression to deal with. |
protected int |
mOffset
The number of bytes offset from which the writing will occur. |
protected boolean |
mPerLine
Indicates whether the action will be performed on a per-line or per-file basis. |
protected java.lang.String |
mRegexp
The regular expression to use to locate the part of the file to write to. |
protected java.lang.String |
mText
The text to use in the file writing. |
static int |
NONE_SPECIFIED
A value denoting the uninitialised nature of the length or offset. |
static boolean |
PER_FILE
Denotes that the action should be applied once on the whole file. |
static boolean |
PER_LINE
Denotes that the action should be applied on each line. |
static int |
REPLACE
Indicates a replacement action. |
static int |
TO_EOF
Denotes the remaining length to the end of the file or line. |
| Constructor Summary | |
FileWriting()
Default constructor. |
|
| Method Summary | |
static java.lang.String |
actionToString(int action)
Return a textual description of a given action type. |
protected java.lang.String |
generateXML()
Generate a perform document with parameters corresponding to the state of the instance variables. |
java.lang.String |
getFilename()
Return the filename of the file to write to. |
int |
getLength()
Return the length to use. |
java.lang.String |
getMatch()
Return the match expression, if any. |
int |
getOffset()
Return the offset to use. |
java.lang.String |
getRegexp()
Return the regular expression to be used, if any. |
java.lang.String |
getText()
Return the directly quoted input text, if any. |
boolean |
isPerLine()
Return whether the action is to be performed on a per-line or per-file basis. |
static java.lang.String |
lengthToString(int length)
Convert an integer representation of a length into an equivalent string, also taking care to convert the special value TO_EOF into
the string "toEOF". |
static java.lang.String |
offsetToString(int offset)
Convert an integer representation of an offset into an equivalent string, also taking care to convert special values BOF and
EOF into corresponding strings. |
void |
setFilename(java.lang.String string)
Set the filename of the file to write to. |
void |
setInput(ActivityOutput input)
Specify the source from which the input text will be obtained. |
void |
setLength(int i)
Set the length to use. |
void |
setMatch(java.lang.String string)
Set the match expression. |
void |
setOffset(int i)
Set the offset to use. |
void |
setPerLine(boolean b)
Return whether the action is to be performed on a per-line or per-file basis. |
void |
setRegexp(java.lang.String string)
Set the regular expression to be used. |
void |
setText(java.lang.String string)
Specify the input text to use. |
protected void |
validateParams()
Test the supplied parameters to check that they are within acceptable bounds. |
| Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity |
addInput, addOutput, addOutputs, getDataResourceID, getDataServiceStub, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setDataServiceStub, setInput |
| Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent |
getName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int REPLACE
public static final int DELETE
public static final int APPEND
public static final int INSERT
public static final int NONE_SPECIFIED
public static final int BOF
public static final int EOF
public static final int TO_EOF
public static final boolean PER_LINE
public static final boolean PER_FILE
protected int mAction
REPLACE, DELETE, APPEND,
INSERT}.
protected java.lang.String mFilename
protected java.lang.String mRegexp
protected java.lang.String mMatch
protected int mOffset
protected int mLength
protected java.lang.String mText
protected boolean mPerLine
true, it is performed on a per-line basis, meaning
that the offset and length will be treated as per-line offsets, and
the regular expression match expression will be interpreted
on a per-line basis. The special values EOF, BOF
and TO_EOF take on meanings relevant to either files or
lines.
| Constructor Detail |
public FileWriting()
| Method Detail |
protected void validateParams()
java.lang.IllegalArgumentException - if any argument is without its boundspublic void setInput(ActivityOutput input)
input - the source of the text
java.lang.IllegalArgumentException - if the argument is nullprotected java.lang.String generateXML()
The three main variables here are:
generateXML in class Activitypublic static java.lang.String offsetToString(int offset)
BOF and
EOF into corresponding strings.
offset - the integer to convert
public static java.lang.String lengthToString(int length)
TO_EOF into
the string "toEOF".
length - the integer to convert
public static java.lang.String actionToString(int action)
action - an action type; one of {REPLACE, DELETE, APPEND, INSERT}
"unknownAction" if the supplied parameter is not recognisedpublic java.lang.String getFilename()
public java.lang.String getMatch()
nullpublic boolean isPerLine()
true if the action is to be performed per-line;false if the action is to be performed per-file.public java.lang.String getRegexp()
nullpublic java.lang.String getText()
nullpublic void setFilename(java.lang.String string)
string - the filenamepublic void setMatch(java.lang.String string)
string - the match expressionpublic void setPerLine(boolean b)
b - true if the action is to be performed per-line;false if the action is to be performed per-file.public void setRegexp(java.lang.String string)
string - the regular expressionpublic void setText(java.lang.String string)
string - the input textpublic int getLength()
TO_EOF; or NONE_SPECIFIEDpublic int getOffset()
EOF; BOFpublic void setLength(int i)
i - the lengthpublic void setOffset(int i)
i - the offset
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||