|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.string.escape.EscapeUnescapeString
Base class for escaping or unescaping characters in a string.
Source code: EscapeUnescapeString.java
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
EscapeUnescapeString(EscapeUnescapeString escape_unescapeString)
Create a full copy of the provided EscapeUnescapeString. |
|
EscapeUnescapeString(ESConfig es_config)
Create an EscapeUnescapeString. |
Method Summary | |
ESConfig |
getESConfig()
Get the ESConfig for direct manipulation. |
int |
getIdx1stUnesc2BEsc(String s_tr)
Get the array index of the first character that should be escaped, but is not. |
int |
getIdx1stUnesc2BEsc(StringBuffer str_buffer)
Get the array index of the first character that should be escaped, but is not. |
int |
getIdx1stUnesc2BEsc(StringBuffer str_buffer,
int i_idxStart)
Get the array index of the first character that should be escaped, but is not. |
int |
getIdx1stUnesc2BEsc(StringBuffer str_buffer,
int i_idxStart,
int i_idxEnd)
Get the array index of the first character that should be escaped, but is not. |
int |
getIdx1stUnesc2BEsc(String s_tr,
int i_idxStart)
Get the array index of the first character that should be escaped, but is not. |
int |
getIdx1stUnesc2BEsc(String s_tr,
int i_idxStart,
int i_idxEnd)
Get the array index of the first character that should be escaped, but is not. |
int |
getIdx1stUnesc2BEsc(StringOrBuffer str_orBfr)
Get the array index of the first character that should be escaped, but is not. |
int |
getIdx1stUnesc2BEsc(StringOrBuffer str_orBfr,
int i_idxStart)
Get the array index of the first character that should be escaped, but is not. |
int |
getIdx1stUnesc2BEsc(StringOrBuffer str_orBfr,
int i_idxStart,
int i_idxEnd)
Get the array index of the first character that should be escaped, but is not. |
boolean |
isEscaped(StringBuffer str_buffer,
int i_dx)
Is the character at the requested array index preceded by the escape character? |
boolean |
isEscaped(String s_tr,
int i_dx)
Is the character at the requested array index preceded by the escape character? |
boolean |
isEscaped(StringOrBuffer str_orBfr,
int i_dx)
Is the character at the requested array index preceded by the escape character? |
Methods inherited from class xbn.XBNObject |
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EscapeUnescapeString(ESConfig es_config)
Create an EscapeUnescapeString.
es_config
- The configuration. May not be null.public EscapeUnescapeString(EscapeUnescapeString escape_unescapeString)
Create a full copy of the provided EscapeUnescapeString.
escape_unescapeString
- The object to copy. May not be null.Method Detail |
public final ESConfig getESConfig()
Get the ESConfig for direct manipulation.
public final boolean isEscaped(String s_tr, int i_dx)
Is the character at the requested array index preceded by the escape character?
isEscaped([UtilString].getSOBSB(s_tr, "isEscaped"), i_dx)
public final boolean isEscaped(StringBuffer str_buffer, int i_dx)
Is the character at the requested array index preceded by the escape character?
isEscaped([UtilStringBuffer].getSOBSB(str_buffer, "isEscaped"), i_dx)
public final boolean isEscaped(StringOrBuffer str_orBfr, int i_dx)
Is the character at the requested array index preceded by the escape character?
Note that this function does not care if the character is one that should be escaped, just that it is preceded by the escape character.
Also, take special care when analyzing a character in a string that is being unescaped on the fly. It is easily possible to confuse things. For example:
\\z
', is the very first '\
' escaped? No. Go on.\\z
', is the second '\
' escaped? Yes. UnescapeString it by eliminating the first '\
' and go on.\z
', is the 'z
' escaped? NO. It appears to be, but we know better...str_orBfr
- The string to analyze. May not be null or zero characters in length.i_dx
- The array index of the character to analyze for escaped-ness. Must be between zero and (str_orBfr.length() - 1), inclusive.str_orBfr.charAt(i_dx)
.
str_orBfr.charAt(i_dx)
.public final int getIdx1stUnesc2BEsc(String s_tr)
Get the array index of the first character that should be escaped, but is not.
getIdx1stUnesc2BEsc([UtilString].getSOBSB(s_tr, "getIdx1stUnesc2BEsc"))
public final int getIdx1stUnesc2BEsc(String s_tr, int i_idxStart)
Get the array index of the first character that should be escaped, but is not.
getIdx1stUnesc2BEsc([UtilString].getSOBSB(s_tr, "getIdx1stUnesc2BEsc"), i_idxStart)
public final int getIdx1stUnesc2BEsc(String s_tr, int i_idxStart, int i_idxEnd)
Get the array index of the first character that should be escaped, but is not.
getIdx1stUnesc2BEsc([UtilString].getSOBSB(s_tr, "getIdx1stUnesc2BEsc"), i_idxStart, i_idxEnd)
public final int getIdx1stUnesc2BEsc(StringBuffer str_buffer)
Get the array index of the first character that should be escaped, but is not.
getIdx1stUnesc2BEsc([UtilStringBuffer].getSOBSB(s_tr, "getIdx1stUnesc2BEsc"))
public final int getIdx1stUnesc2BEsc(StringBuffer str_buffer, int i_idxStart)
Get the array index of the first character that should be escaped, but is not.
getIdx1stUnesc2BEsc([UtilStringBuffer].getSOBSB(str_buffer, "getIdx1stUnesc2BEsc"), i_idxStart)
public final int getIdx1stUnesc2BEsc(StringBuffer str_buffer, int i_idxStart, int i_idxEnd)
Get the array index of the first character that should be escaped, but is not.
getIdx1stUnesc2BEsc([UtilStringBuffer].getSOBSB(str_buffer, "getIdx1stUnesc2BEsc"), i_idxStart, i_idxEnd)
public final int getIdx1stUnesc2BEsc(StringOrBuffer str_orBfr)
Get the array index of the first character that should be escaped, but is not.
getIdx1stUnesc2BEsc(str_orBfr, 0)
public final int getIdx1stUnesc2BEsc(StringOrBuffer str_orBfr, int i_idxStart)
Get the array index of the first character that should be escaped, but is not.
str_orBfr
- The StringOrBuffer to analyze. May not be null.getIdx1stUnesc2BEsc(str_orBfr, i_idxStart, (str_orBfr.length() - 1))
public final int getIdx1stUnesc2BEsc(StringOrBuffer str_orBfr, int i_idxStart, int i_idxEnd)
Get the array index of the first character that should be escaped, but is not.
Note: Be careful that the value of i_idxStart
/i_idxEnd
(whichever is lower/smaller/more-to-the-left) is the index of a character that is not escaped. Otherwise, this function will give you inaccurate results.
str_orBfr
- The StringBuffer to analyze. May not be null or zero characters in length.i_idxStart
- The first array index to analyze. Must be between zero and (str_orBfr.length() - 1), inclusive. Note that this may be greater than i_idxEnd, should you want to analyze right to left.i_idxEnd
- The last array index to analyze. Must be between zero and (str_orBfr.length() - 1), inclusive.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
http://sourceforge.net/projects/xbnjava