|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fipaos.util.StringParser
Provides methods to parse strings for ACL message fields. Useful for when you have an ACL message (or bit of one) as a string from which you want one or two fields - saves the overhead of a whole ACL parser.
Field Summary | |
static java.lang.String |
ACTION_TYPE
|
static java.lang.String |
PERFORMATIVE
|
Constructor Summary | |
StringParser()
|
Method Summary | |
static boolean |
contains(java.lang.String look_for,
java.lang.String to_parse)
Indicates whether the word to search for is actually present in the string to be parsed. |
static java.lang.String |
getBracketedExpression(int start_from,
java.lang.String to_parse)
Returns an entire bracketed expression from the given string starting from the index given. |
static java.lang.String |
getBracketedExpression(int start_from,
java.lang.String to_parse,
boolean keep_brackets)
Returns an entire bracketed expression from the given string starting from the index given. |
static java.lang.String |
getNextBracketedExpression(java.lang.String str)
Gets the first bracketed expression from the String list |
static int |
getNoOfBracketedExpressions(java.lang.String expressions)
When given a list of bracketed expressions as a string and a tag within the expressions, this method will instanses of the expression are in the list |
static java.util.List |
parseACL(java.lang.String messages)
Method to provide conversion between a document containing ACL messages and a List of ACL objects - returns null if anything goes wrong |
static java.lang.String |
parseFor(java.lang.String look_for,
java.lang.String to_parse)
Parses a string for the given ACL field (any field can be given except :receiver and :envelope) Note: Giving ":performative" as the field name will return the message type. Giving ":action-type" as the field to look for will return the next keyword after an "(action ..." statement in the string. |
static int |
parseForIndex(java.lang.String look_for,
java.lang.String to_parse)
Parses the given string for the string specified, and returns the index of the character immediately following the end of that string ( e.g. |
static java.util.Vector |
parseForList(java.lang.String look_for,
java.lang.String to_parse)
Parses the supplied string for a list of space seperated values marked by the look-for parameter. |
static java.util.Vector |
parseForVector(java.lang.String look_for,
java.lang.String to_parse)
Parses a string for the ACL envelope or receiver field and returns the contents in a vector. |
static java.lang.String |
removeExpressionFromList(java.lang.String str)
given a list of bracketed expressions as a string this function will return the list with the first expression removed |
static java.lang.String |
trimBrackets(java.lang.String content)
Strips the outside pair of brackets from a string. |
static java.lang.String |
trimSquareBrackets(java.lang.String content)
Strips the outside pair of brackets from a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ACTION_TYPE
public static final java.lang.String PERFORMATIVE
Constructor Detail |
public StringParser()
Method Detail |
public static java.lang.String parseFor(java.lang.String look_for, java.lang.String to_parse)
look_for
- ACL field to look forto_parse
- String to look inpublic static java.util.Vector parseForVector(java.lang.String look_for, java.lang.String to_parse)
look_for
- the ACL field to findto_parse
- the string to parsepublic static java.lang.String removeExpressionFromList(java.lang.String str)
str
- list of bracketed expressions as a listpublic static int getNoOfBracketedExpressions(java.lang.String expressions)
expressions
- list of bracketed expressions as a listtag
- Tag for which to searchpublic static java.lang.String getNextBracketedExpression(java.lang.String str)
str
- String List of bracketed expressionspublic static java.util.List parseACL(java.lang.String messages)
public static int parseForIndex(java.lang.String look_for, java.lang.String to_parse)
look_for
- The string to parse forto_parse
- The string to look ingetBracketedExpression
public static java.lang.String getBracketedExpression(int start_from, java.lang.String to_parse)
start_from
- The index to start fromto_parse
- The string to look inpublic static java.lang.String getBracketedExpression(int start_from, java.lang.String to_parse, boolean keep_brackets)
start_from
- The index to start fromto_parse
- The string to look inkeep_brackets
- True if the output should still have the enclosing brackets, false otherwisepublic static boolean contains(java.lang.String look_for, java.lang.String to_parse)
look_for
- The word to check forto_parse
- The string to check for keyword inpublic static java.util.Vector parseForList(java.lang.String look_for, java.lang.String to_parse)
(:address agent1@iiop://47.47.47.47:9000/acc agent2@wap://123456789/acc)
look_for
- The field marker to extract values forto_parse
- The content to look inpublic static java.lang.String trimBrackets(java.lang.String content)
content
- The string to remove the brackets frompublic static java.lang.String trimSquareBrackets(java.lang.String content)
content
- The string to remove the brackets from
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |