/* XBN Java: Generically useful, non-GUI Java code. http://sourceforge.net/projects/xbnjava Copyright (C) 1997-2003, Jeff Epstein All rights reserved. Modifications: No Redistribution in binary form, with or without modifications, are permitted provided that the following conditions are met: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * If modifications are made to source code then this license should indicate that fact in the "Modifications" section above. * Neither the author, nor the contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [NOTE: This license contains NO advertising clause.] */ package xbn.string.escape; /**
Configuration for UnescapeString. See UnescapeString.
Source code: USConfig.java
Create an USConfig with default values.
Equal to USConfig(getEscapeCharDefault())
Create an USConfig.
Equal to USConfig(c_escape, (new char[] {}))
Create an USConfig.
Equal to USConfig(getEscapeCharDefault(), ac_toEscape)
Create an USConfig.
Equal to USConfig(getEscapeCharDefault(), euscu_ignore)
Create an USConfig.
Equal to USConfig(c_escape, ac_toEscape, (new USCIgnore()))
Create an USConfig.
Equal to USConfig(c_escape, (new char[] {}), euscu_ignore)
Create an USConfig.
Equal to USConfig(getEscapeCharDefault(), ac_toEscape, euscu_ignore)
Create an USConfig.
The first line of this constructor calls ESConfig(c_escape, ac_toEscape)
euscu_ignore.getAPCIgnore()
is greater than zero elements, then no element may equal c_escape, nor any character in ac_toEscape.
**/
public USConfig(char c_escape, char[] ac_toEscape, USCIgnore euscu_ignore) {
super(c_escape, ac_toEscape);
throwAXIfNull(euscu_ignore, "euscu_ignore", sCNSTR);
boolean bAPCINotEmpty = false;
try {
bAPCINotEmpty = (euscu_ignore.getAPCIgnore().getLength() > 0);
} catch(NullPointerException npx) {
throwAX("constructor: euscu_ignore is null.");
}
if(bAPCINotEmpty) {
if(euscu_ignore.isSpcfcIgnored(c_escape)) {
throwAX("constructor: euscu_ignore.getAPCIgnore() contains c_escape ('" + c_escape + "').");
}
for(int i = 0; i < ac_toEscape.length; i++) {
if(euscu_ignore.isSpcfcIgnored(ac_toEscape[i])) {
throwAX("constructor: euscu_ignore.getAPCIgnore() contains ac_toEscape[" + i + "] ('" + ac_toEscape[i] + "').");
}
}
}
usci = euscu_ignore;
}
/**
Create a full (deep) copy of the provided USConfig.
The first line of this constructor calls ESConfig(us_config)
Get the USCIgnore for direct manipulation.
@return euscu_ignore Exactly as provided to the constructor. **/ public final USCIgnore getUSCIgnore() { return usci; } /**Get some information about this EUSCUsescape.
**/ public String toString() { return super.toString() + ", [" + getUSCIgnore().toString() + "]"; } }