xbn.string.escape
Class UnescapeString

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.string.escape.EscapeUnescapeString
              |
              +--xbn.string.escape.UnescapeString

public class UnescapeString
extends EscapeUnescapeString

Unescape characters in a string.

Source code:  UnescapeString.java

"UnescapeString", meaning: Delete the escape character existing immediately before another character.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
UnescapeString(UnescapeString unescape_string)
          Create a full copy of the provided UnescapeString.
UnescapeString(USConfig us_config)
          Create an EscapeUnescapeString.
 
Method Summary
 String get(String s_tr)
          Get a copy of the string where all characters that need to be escaped, are.
 String get(String s_tr, int i_idxErrOffset)
          Get a copy of the string where all characters that need to be escaped, are.
 USConfig getUSConfig()
          Get the USConfig for direct manipulation.
 int unescape(StringBuffer str_buffer)
          UnescapeString all characters that need to be.
 int unescape(StringBuffer str_buffer, int i_idxErrOffset)
          UnescapeString all characters that need to be.
 int unescape(StringOrBuffer str_orBfr)
          UnescapeString all characters that need to be.
 int unescape(StringOrBuffer str_orBfr, int i_idxErrOffset)
          UnescapeString all characters that need to be.
 
Methods inherited from class xbn.string.escape.EscapeUnescapeString
getESConfig, getIdx1stUnesc2BEsc, getIdx1stUnesc2BEsc, getIdx1stUnesc2BEsc, getIdx1stUnesc2BEsc, getIdx1stUnesc2BEsc, getIdx1stUnesc2BEsc, getIdx1stUnesc2BEsc, getIdx1stUnesc2BEsc, getIdx1stUnesc2BEsc, isEscaped, isEscaped, isEscaped
 
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

UnescapeString

public UnescapeString(USConfig us_config)

Create an EscapeUnescapeString.

Equal to EscapeUnescapeString(us_config)


UnescapeString

public UnescapeString(UnescapeString unescape_string)

Create a full copy of the provided UnescapeString.

Equal to EscapeUnescapeString(unescape_string)

Method Detail

getUSConfig

public final USConfig getUSConfig()

Get the USConfig for direct manipulation.

Returns:
(USConfig)getESConfig()

get

public final String get(String s_tr)
                 throws UnescapeStringException

Get a copy of the string where all characters that need to be escaped, are.

Returns:
The contents of getSOBS: unescape([UtilString].getSOBSB(s_tr, "get"))

get

public final String get(String s_tr,
                        int i_idxErrOffset)
                 throws UnescapeStringException

Get a copy of the string where all characters that need to be escaped, are.

Returns:
The contents of getSOBS: unescape([UtilString].getSOBSB(s_tr, "get"), i_idxErrOffset)

unescape

public final int unescape(StringBuffer str_buffer)
                   throws UnescapeStringException

UnescapeString all characters that need to be.

Returns:
unescape([UtilStringBuffer].getSOBSB(str_buffer, "unescape"))

unescape

public final int unescape(StringBuffer str_buffer,
                          int i_idxErrOffset)
                   throws UnescapeStringException

UnescapeString all characters that need to be.

Returns:
unescape([UtilStringBuffer].getSOBSB(str_buffer, "unescape"), i_idxErrOffset)

unescape

public final int unescape(StringOrBuffer str_orBfr)
                   throws UnescapeStringException

UnescapeString all characters that need to be.

Returns:
unescape(str_orBfr, 0)

unescape

public final int unescape(StringOrBuffer str_orBfr,
                          int i_idxErrOffset)
                   throws UnescapeStringException

UnescapeString all characters that need to be. This removes the escape character from before the characters it is escaping. See USConfig for more information.

Parameters:
str_orBfr - Contains the string that needs to have its characters un-escaped. May not be null.
i_idxErrOffset - For use only in error messages. This number is the offset to make the error messages display the proper--overall--character array index. When str_orBfr is actually a part of a larger string, use this to make error messages display the original character array index, as if str_orBfr were still part of the larger string.
Returns:
The number of (escape) characters deleted.
Throws:
UnescapeStringException - If either condition is true:
  • A character that should be escaped (including a stray escape character) is not escaped (is not preceded by an escape character).
  • A character that is escaped is not among those characters that should be, and that character is not ignored.



Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo