/** * @param QName[local] which may contain unescaped backslashes * @return QName[local] w/ escaped backslashes */ public static QName getQNameWithBackslashedLocal(QName suspectQName) { String trustedString = null; // get a wsdl:service[@name] with safe backslashes trustedString = applyBackslashes(suspectQName.getLocalPart()); return getQNameWithDifferentLocal(suspectQName, trustedString); }
/** * @param QName[local] that may contain unescaped backslashes * @return QName[local] w/ no backslashes */ public static QName getQNameWithBackslashlessLocal(QName suspectQName) { String trustedString = null; // get a wsdl:service[@name] that we can trust trustedString = stripBackslashes(suspectQName.getLocalPart()); return getQNameWithDifferentLocal(suspectQName, trustedString); }
/** * Slave method for getQNameWithBackslashedLocal() */ public static String applyBackslashes(String string) { return transformBackslashes(string, false); }
/** * Write the getServiceName method. * * @param pw * @param qname */ protected void writeGetServiceName(PrintWriter pw, QName qname) { String originalServiceName = null; QName qNameWithDifferentLocal = null; QName qNameWithBackslashedLocal = null; originalServiceName = sEntry.getOriginalServiceName(); qNameWithDifferentLocal = BackslashUtil.getQNameWithDifferentLocal(qname, originalServiceName); qNameWithBackslashedLocal = BackslashUtil.getQNameWithBackslashedLocal(qNameWithDifferentLocal); pw.println(" public javax.xml.namespace.QName getServiceName() {"); pw.println(" return " + Utils.getNewQName(qNameWithBackslashedLocal) + ";"); pw.println(" }"); pw.println(); } // writeGetServiceName
/** * Populate the symbol table with all of the ServiceEntry's from the Definition. * * @param def * @throws IOException */ private void populateServices(Definition def) throws IOException { String originalName = null; Iterator i = def.getServices().values().iterator(); while (i.hasNext()) { Service service = (Service) i.next(); originalName = service.getQName().getLocalPart(); // do a bit of name validation if ((service.getQName() == null) || (service.getQName().getLocalPart() == null) || service.getQName().getLocalPart().equals("")) { throw new IOException(Messages.getMessage("BadServiceName00")); } // behave as though backslashes were never there service.setQName(BackslashUtil.getQNameWithBackslashlessLocal(service.getQName())); ServiceEntry sEntry = new ServiceEntry(service); // we'll need this later when it is time print a backslash escaped service name sEntry.setOriginalServiceName(originalName); symbolTablePut(sEntry); populatePorts(service.getPorts()); } } // populateServices
/** * Write the getServiceName method. * * @param pw * @param qname */ protected void writeGetServiceName(PrintWriter pw, QName qname) { String originalServiceName = null; QName qNameWithDifferentLocal = null; QName qNameWithBackslashedLocal = null; originalServiceName = sEntry.getOriginalServiceName(); qNameWithDifferentLocal = BackslashUtil.getQNameWithDifferentLocal(qname, originalServiceName); qNameWithBackslashedLocal = BackslashUtil.getQNameWithBackslashedLocal(qNameWithDifferentLocal); pw.println(" public javax.xml.namespace.QName getServiceName() {"); pw.println(" return " + Utils.getNewQName(qNameWithBackslashedLocal) + ";"); pw.println(" }"); pw.println(); } // writeGetServiceName
/** * Populate the symbol table with all of the ServiceEntry's from the Definition. * * @param def * @throws IOException */ private void populateServices(Definition def) throws IOException { String originalName = null; Iterator i = def.getServices().values().iterator(); while (i.hasNext()) { Service service = (Service) i.next(); originalName = service.getQName().getLocalPart(); // do a bit of name validation if ((service.getQName() == null) || (service.getQName().getLocalPart() == null) || service.getQName().getLocalPart().equals("")) { throw new IOException(Messages.getMessage("BadServiceName00")); } // behave as though backslashes were never there service.setQName(BackslashUtil.getQNameWithBackslashlessLocal(service.getQName())); ServiceEntry sEntry = new ServiceEntry(service); // we'll need this later when it is time print a backslash escaped service name sEntry.setOriginalServiceName(originalName); symbolTablePut(sEntry); populatePorts(service.getPorts()); } } // populateServices
/** * @param QName[local] which may contain unescaped backslashes * @return QName[local] w/ escaped backslashes */ public static QName getQNameWithBackslashedLocal(QName suspectQName) { String trustedString = null; // get a wsdl:service[@name] with safe backslashes trustedString = applyBackslashes(suspectQName.getLocalPart()); return getQNameWithDifferentLocal(suspectQName, trustedString); }
/** * @param QName[local] that may contain unescaped backslashes * @return QName[local] w/ no backslashes */ public static QName getQNameWithBackslashlessLocal(QName suspectQName) { String trustedString = null; // get a wsdl:service[@name] that we can trust trustedString = stripBackslashes(suspectQName.getLocalPart()); return getQNameWithDifferentLocal(suspectQName, trustedString); }
/** * Write the getServiceName method. * * @param pw * @param qname */ protected void writeGetServiceName(PrintWriter pw, QName qname) { String originalServiceName = null; QName qNameWithDifferentLocal = null; QName qNameWithBackslashedLocal = null; originalServiceName = sEntry.getOriginalServiceName(); qNameWithDifferentLocal = BackslashUtil.getQNameWithDifferentLocal(qname, originalServiceName); qNameWithBackslashedLocal = BackslashUtil.getQNameWithBackslashedLocal(qNameWithDifferentLocal); pw.println(" public javax.xml.namespace.QName getServiceName() {"); pw.println(" return " + Utils.getNewQName(qNameWithBackslashedLocal) + ";"); pw.println(" }"); pw.println(); } // writeGetServiceName
/** * Slave method for getQNameWithBackslashlessLocal */ public static String stripBackslashes(String string) { return transformBackslashes(string, true); }
/** * Populate the symbol table with all of the ServiceEntry's from the Definition. * * @param def * @throws IOException */ private void populateServices(Definition def) throws IOException { String originalName = null; Iterator i = def.getServices().values().iterator(); while (i.hasNext()) { Service service = (Service) i.next(); originalName = service.getQName().getLocalPart(); // do a bit of name validation if ((service.getQName() == null) || (service.getQName().getLocalPart() == null) || service.getQName().getLocalPart().equals("")) { throw new IOException(Messages.getMessage("BadServiceName00")); } // behave as though backslashes were never there service.setQName(BackslashUtil.getQNameWithBackslashlessLocal(service.getQName())); ServiceEntry sEntry = new ServiceEntry(service); // we'll need this later when it is time print a backslash escaped service name sEntry.setOriginalServiceName(originalName); symbolTablePut(sEntry); populatePorts(service.getPorts()); } } // populateServices
/** * @param QName[local] which may contain unescaped backslashes * @return QName[local] w/ escaped backslashes */ public static QName getQNameWithBackslashedLocal(QName suspectQName) { String trustedString = null; // get a wsdl:service[@name] with safe backslashes trustedString = applyBackslashes(suspectQName.getLocalPart()); return getQNameWithDifferentLocal(suspectQName, trustedString); }
/** * @param QName[local] that may contain unescaped backslashes * @return QName[local] w/ no backslashes */ public static QName getQNameWithBackslashlessLocal(QName suspectQName) { String trustedString = null; // get a wsdl:service[@name] that we can trust trustedString = stripBackslashes(suspectQName.getLocalPart()); return getQNameWithDifferentLocal(suspectQName, trustedString); }
/** * Slave method for getQNameWithBackslashedLocal() */ public static String applyBackslashes(String string) { return transformBackslashes(string, false); }
/** * Slave method for getQNameWithBackslashlessLocal */ public static String stripBackslashes(String string) { return transformBackslashes(string, true); }
/** * Slave method for getQNameWithBackslashlessLocal */ public static String stripBackslashes(String string) { return transformBackslashes(string, true); }
/** * Slave method for getQNameWithBackslashedLocal() */ public static String applyBackslashes(String string) { return transformBackslashes(string, false); }