|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.string.escape.USCIgnore
Defines which characters, when escaped, should be ignored (that is, left escaped without causing an error). This affects every character not defined as "to-be-escaped" (see ESConfig.getAPCToEscape()).
Source code: USCIgnore.java
When the same string is escaped in multiple phases, then it's most likely that something needs to be ignored. Otherwise, characters that should be unescaped in phase two (but not phase one) will cause an UnescapeStringException during phase one.
On the other hand, when there will only be one phase of escaping (or the current phase is definitely the final one), then you may want to generate an error when an incorrectly escaped character exists.
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
|
USCIgnore()
Create a USCIgnore with default settings. |
|
USCIgnore(boolean b_ignoreAll)
Create a USCIgnore. |
protected |
USCIgnore(boolean b_ignoreAll,
char[] ac_ignore)
Create a USCIgnore. |
|
USCIgnore(char[] ac_ignore)
Create a USCIgnore. |
Method Summary | |
protected Object |
clone()
Get a full (deep) copy of this USCIgnore as an Object. |
boolean |
doIgnoreAll()
Should all non-should-be-escaped characters be ignored? |
APChar |
getAPCIgnore()
What specific non-to-be-escaped characters should be ignored? |
USCIgnore |
getEUSCUIClone()
Get a full (deep) copy of this USCIgnore. |
boolean |
hasCharToIgnore()
Is at least on character ignored? |
boolean |
isSpcfcIgnored(char c_har)
Is the provided character one that should be specifically ignored? |
String |
toString()
Get some information about this USCIgnore. |
Methods inherited from class xbn.XBNObject |
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public USCIgnore()
Create a USCIgnore with default settings.
Equal to USCIgnore(true)
public USCIgnore(boolean b_ignoreAll)
Create a USCIgnore.
Equal to USCIgnore(b_ignoreAll, (new char[] {}))
public USCIgnore(char[] ac_ignore)
Create a USCIgnore.
Equal to USCIgnore(false, ac_ignore)
protected USCIgnore(boolean b_ignoreAll, char[] ac_ignore)
Create a USCIgnore.
b_ignoreAll
- Should all non-to-be-escaped chars be ignored (left escaped without causing an error)? If true, yes. If false, no. When true, ac_ignore must be zero elements in length. See doIgnoreAll.ac_ignore
- The specific array of chars to be ignored. May not be null. If zero elements in length, no specific characters are ignored. If more zero elements, then each character element should be unique, must not equal the escape character, nor any character defined as to-be-escaped (verifying that the characters are are not illegal is checked in the USConfig constructor, not here). When more than zero elements in length, b_ignoreAll must equal false. See getAPCIgnore.Method Detail |
public final boolean doIgnoreAll()
Should all non-should-be-escaped characters be ignored?
If this function returns true, then all escaped characters (not including the escape character and those defined as to-be-escaped) are ignored. If false, then specific characters may be ignored, but "every" one is not.
public final APChar getAPCIgnore()
What specific non-to-be-escaped characters should be ignored?
When the length of the returned APChar is zero, then doIgnoreAll may return true or false. When the returned contains at least one element, doIgnoreAll always returns false.
public final boolean isSpcfcIgnored(char c_har)
Is the provided character one that should be specifically ignored?
Use this in tandem with doIgnoreAll to truly determite whether a character should be ignored.
c_har
- The character to analyze for ignore-ness.(Arrays.binarySearch(ac_ignore, c_har) > -1)
, where ac_ignore is exactly as provided to the constructor.public final boolean hasCharToIgnore()
Is at least on character ignored?
(doIgnoreAll() || getAPCIgnore().getLength() > 0)
public String toString()
Get some information about this USCIgnore.
toString
in class Object
public final USCIgnore getEUSCUIClone()
Get a full (deep) copy of this USCIgnore.
(USCIgnore)clone()
protected Object clone() throws CloneNotSupportedException
Get a full (deep) copy of this USCIgnore as an Object.
clone
in class Object
|
|||||||||
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