Methods Summary |
---|
public static java.lang.String | applyBackslashes(java.lang.String string)Slave method for getQNameWithBackslashedLocal()
return transformBackslashes(string, false);
|
public static javax.xml.namespace.QName | getQNameWithBackslashedLocal(javax.xml.namespace.QName suspectQName)
String trustedString = null;
// get a wsdl:service[@name] with safe backslashes
trustedString = applyBackslashes(suspectQName.getLocalPart());
return getQNameWithDifferentLocal(suspectQName, trustedString);
|
public static javax.xml.namespace.QName | getQNameWithBackslashlessLocal(javax.xml.namespace.QName suspectQName)
String trustedString = null;
// get a wsdl:service[@name] that we can trust
trustedString = stripBackslashes(suspectQName.getLocalPart());
return getQNameWithDifferentLocal(suspectQName, trustedString);
|
public static javax.xml.namespace.QName | getQNameWithDifferentLocal(javax.xml.namespace.QName qName, java.lang.String localName)Creates a copy of the supplied QName w/ the supplied local name
QName trustedQName = null;
// recreate the QName, only w/ a local name we can trust.
trustedQName = new QName(qName.getNamespaceURI(), localName, qName.getPrefix());
return trustedQName;
|
public static java.lang.String | stripBackslashes(java.lang.String string)Slave method for getQNameWithBackslashlessLocal
return transformBackslashes(string, true);
|
public static java.lang.String | transformBackslashes(java.lang.String string, boolean delete)Slave method for applyBackslashes & stripBackslashes .
byte[] suspectBytes = null;
StringBuffer stringBuffer = null;
suspectBytes = string.getBytes();
stringBuffer = new StringBuffer(string);
for (int b = suspectBytes.length - 1; b >= 0; b--) {
if (suspectBytes[b] == 92) {
if(delete){
stringBuffer.delete(b, b + 1);
}else{
stringBuffer.insert(b, "\\");
}
}
}
return stringBuffer.toString();
|