|
webMethods Broker Administration Java API Version 9.5.1.0.171 091713 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCOM.activesw.api.client.BrokerFormat
public class BrokerFormat
String formatting functions. The string can reference values from an Object (currently only supports BrokerEvent). See also BrokerEvent.toFormattedString(...). Event fields can be referenced in the format string by a $ character followed by the fully qualified event field name. The name is terminated by the first space character following the $ character, or it can be enclosed in curly braces: $foo ${foo} $struct.sequence[3].field a${foo}b Optionally, a format specifier can be appended to each field name with a ':': $foo:x ${foo:x} The following formatting options are supported:
:s - sinqle quoting. Enclose the value in <'>, and escape single quotes in the value with a <\> :d - double quotes. Enclose the value in <">, and escape double quotes in the value with <\> :q - SQL quoting. Like :s, but escape with <'> :v - Bind variable mode. Primarly intended for use with databases, Replace the reference with a proper bind variable placeholder. Default is Oracle style, as in :v0, :v1, :v2. Can be changed to use with the setFormatMode() call. :c - numeric. Use value as numeric value. If value is non-numeric, any non-numeric portions will be discarded. I.e. if the value is "123X", only "123" will be used in the result. :###x - Specify a minimum field length together with one of the options above, i.e. <:5d> will print a value of'\' can be used to escape the following character outside of variable names. To get a '$' character into the result, escape it with a '\', i.e. \\\a\$foo will be returned as \a$fooas <'AB '>.
Field Summary | |
---|---|
protected static char |
modeV
|
Constructor Summary | |
---|---|
BrokerFormat(java.lang.String format_string)
Constructor. |
Method Summary | |
---|---|
static java.lang.String |
assemble(BrokerEvent event,
java.util.Vector tokens)
Assemble a string from the tokens, replacing references with values from the event. |
static java.lang.String |
assemble(BrokerEvent event,
java.util.Vector tokens,
java.util.Locale locale)
Assemble a string from the tokens, replacing references with values from the event. |
static java.lang.String |
assemble(java.util.Vector tokens)
Assemble a string from the tokens, without an event reference. |
java.lang.String |
format()
Return formatted string, without event data. |
java.lang.String |
format(BrokerEvent event)
Return formatted string, using |
java.lang.String |
format(BrokerEvent event,
java.util.Locale locale)
Return formatted string, using |
static java.lang.String |
format(BrokerEvent event,
java.lang.String format_string)
Format an event using a format string. |
static java.lang.String |
format(BrokerEvent event,
java.lang.String format_string,
java.util.Locale locale)
Format an event using a format string. |
java.lang.String |
formatBindVariable(int index,
java.lang.StringBuffer place_holder_name)
Returns the name of the bind variable at token |
int |
getTokenCount()
Returns the number of tokens. |
java.lang.String |
getTokenValue(int t)
Return the value of a token. |
boolean |
isReferenceToken(int t)
Checks if a token is a reference to an event field. |
static java.util.Vector<COM.activesw.api.client.BrokerFormatToken> |
preparse(java.lang.String format_string)
Take a string, and break it up into a list of tokens. |
static boolean |
setFormatMode(java.lang.String format_option,
java.lang.String mode)
set the mode for a format option (see above). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static char modeV
Constructor Detail |
---|
public BrokerFormat(java.lang.String format_string)
format_string
-
...
Method Detail |
---|
public int getTokenCount()
public boolean isReferenceToken(int t)
t
- token number
public java.lang.String getTokenValue(int t)
t
- token number
public java.lang.String format()
public java.lang.String format(BrokerEvent event) throws BrokerException
event
- the event for the data
BrokerException
public java.lang.String format(BrokerEvent event, java.util.Locale locale) throws BrokerException
event
- the event for the datalocale
- determines format of field value output
BrokerException
public static boolean setFormatMode(java.lang.String format_option, java.lang.String mode)
public static java.lang.String format(BrokerEvent event, java.lang.String format_string) throws BrokerException
format(event, format_string, java.util.Locale.US)
event
- the event for the dataformat_string
- the format string
BrokerException
public static java.lang.String format(BrokerEvent event, java.lang.String format_string, java.util.Locale locale) throws BrokerException
event
- the event for the dataformat_string
- the format stringlocale
- determines formatting of field values
BrokerException
public static java.util.Vector<COM.activesw.api.client.BrokerFormatToken> preparse(java.lang.String format_string)
public static java.lang.String assemble(BrokerEvent event, java.util.Vector tokens) throws BrokerException
assemble(event,tokens,java.util.Locale.US)
Deprecated - consider using format() method instead
BrokerFieldNotFoundException
- If a field is referenced in the format string that is not in the event.
BrokerInvalidTypeException
- If a field is not of a type supported by the string formatter.
BrokerException
public static java.lang.String assemble(BrokerEvent event, java.util.Vector tokens, java.util.Locale locale) throws BrokerException
BrokerFieldNotFoundException
- If a field is referenced in the format string that is not in the event.
BrokerInvalidTypeException
- If a field is not of a type supported by the string formatter.
BrokerException
public static java.lang.String assemble(java.util.Vector tokens)
public java.lang.String formatBindVariable(int index, java.lang.StringBuffer place_holder_name)
|
webMethods Broker Administration Java API Version 9.5.1.0.171 091713 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |