com.wewebu.ow.server.util
Class OwEscapedStringTokenizer

java.lang.Object
  extended by com.wewebu.ow.server.util.OwEscapedStringTokenizer

public class OwEscapedStringTokenizer
extends Object

Utility class to tokenize strings with escape characters.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
static char STANDARD_DELIMITER
          the standard delimiter character to be used
static char STANDARD_ESCAPE
          the standard escape character to be used
 
Constructor Summary
OwEscapedStringTokenizer(String text_p)
           
OwEscapedStringTokenizer(String text_p, char delimiter_p, char escapechar_p)
           
 
Method Summary
protected static void appendEscapedToken(StringBuffer buf_p, String token_p, char delimiter_p, char escape_p)
          append the given token converting it with given escapes
static String createDelimitedString(Collection tokens_p)
          create a delimited string out of the given string collection that can later be tokenized
static String createDelimitedString(Collection tokens_p, char delimiter_p, char escape_p)
          create a delimited string out of the given string collection that can later be tokenized
 boolean hasNext()
           
 String next()
          get next token
 Collection toCollection()
          convert the tokenizer into a collection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STANDARD_DELIMITER

public static final char STANDARD_DELIMITER
the standard delimiter character to be used

See Also:
Constant Field Values

STANDARD_ESCAPE

public static final char STANDARD_ESCAPE
the standard escape character to be used

See Also:
Constant Field Values
Constructor Detail

OwEscapedStringTokenizer

public OwEscapedStringTokenizer(String text_p,
                                char delimiter_p,
                                char escapechar_p)
Parameters:
text_p -
delimiter_p -
escapechar_p -

OwEscapedStringTokenizer

public OwEscapedStringTokenizer(String text_p)
Parameters:
text_p -
Method Detail

hasNext

public boolean hasNext()

next

public String next()
get next token

Returns:
String

toCollection

public Collection toCollection()
convert the tokenizer into a collection

Returns:
Collection of tokens

createDelimitedString

public static String createDelimitedString(Collection tokens_p)
create a delimited string out of the given string collection that can later be tokenized

Parameters:
tokens_p -

createDelimitedString

public static String createDelimitedString(Collection tokens_p,
                                           char delimiter_p,
                                           char escape_p)
create a delimited string out of the given string collection that can later be tokenized

Parameters:
tokens_p -
delimiter_p -
escape_p -

appendEscapedToken

protected static void appendEscapedToken(StringBuffer buf_p,
                                         String token_p,
                                         char delimiter_p,
                                         char escape_p)
append the given token converting it with given escapes

Parameters:
buf_p -
token_p -
delimiter_p -
escape_p -


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.