private static boolean isSame(QName messageQName, QName methodQName) { boolean same = false; if (StringUtils.isEmpty(messageQName.getNamespaceURI())) { same = messageQName.getLocalPart().equals(methodQName.getLocalPart()); } else { same = messageQName.equals(methodQName); } return same; }
public static boolean isFileAbsolute(String file) { return isFileExist(file) && new File(file).isAbsolute(); }
private String getNodeName(String expression) { return StringUtils.extract(expression, "[@name='", "']"); }
private boolean isValidJaxwsBindingFile(String bindingLocation, XMLStreamReader reader) { try { if (ToolConstants.JAXWS_BINDINGS.equals(reader.getName())) { String wsdlURL = (String)env.get(ToolConstants.CFG_WSDLURL); wsdlURL = ProcessorUtil.absolutize(ProcessorUtil.getFileOrURLName(wsdlURL)); String wsdlLocation = reader.getAttributeValue(null, "wsdlLocation"); if (StringUtils.isFileExist(bindingLocation) && !StringUtils.isFileAbsolute(wsdlLocation)) { String basedir = new File(bindingLocation).getParent(); wsdlLocation = new File(basedir, wsdlLocation).getAbsolutePath(); } wsdlLocation = ProcessorUtil.absolutize(ProcessorUtil.getFileOrURLName(wsdlLocation)); if (!StringUtils.getURL(wsdlURL).equals(StringUtils.getURL(wsdlLocation))) { Message msg = new Message("NOT_POINTTO_URL", LOG, new Object[]{wsdlLocation, wsdlURL}); throw new ToolException(msg); } } else { return false; } } catch (MalformedURLException e) { Message msg = new Message("CAN_NOT_GET_WSDL_LOCATION", LOG); throw new ToolException(msg, e); } return true; }
private String wrapper(String nodeName) { return StringUtils.wrapper(nodeName, "[@name='", "']"); } }
public void load(InputStream is, String delim) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line = br.readLine(); while (!StringUtils.isEmpty(line)) { StringTokenizer st = new StringTokenizer(line, delim); String key = null; String value = null; if (st.hasMoreTokens()) { key = st.nextToken().trim(); } if (st.hasMoreTokens()) { value = st.nextToken().trim(); } maps.put(key, value); line = br.readLine(); } br.close(); }
private void customizeSchema(Element schema, String targetNamespace) { String userPackage = env.mapPackageName(targetNamespace); if (env.hasExcludeNamespace(targetNamespace) && env.getExcludePackageName(targetNamespace) != null) { // generate excluded namespace types classes with specified package // name userPackage = env.getExcludePackageName(targetNamespace); } if (!isSchemaParsed(targetNamespace) && !StringUtils.isEmpty(userPackage)) { Node jaxbBindings = JAXBUtils.innerJaxbPackageBinding(schema, userPackage); schema.appendChild(jaxbBindings); } int nodeListLen = schema.getElementsByTagNameNS(ToolConstants.SCHEMA_URI, "import").getLength(); for (int i = 0; i < nodeListLen; i++) { removeImportElement(schema); } }
private void addWebMethodAnnotation(JavaMethod method, String operationName) { JavaAnnotation methodAnnotation = new JavaAnnotation("WebMethod"); methodAnnotation.addArgument("operationName", operationName); if (!StringUtils.isEmpty(method.getSoapAction())) { methodAnnotation.addArgument("action", method.getSoapAction()); } method.addAnnotation("WebMethod", methodAnnotation); method.getInterface().addImport("javax.jws.WebMethod"); }
public boolean isValid() throws ToolException { boolean isValid = true; String schemaDir = getSchemaDir(); if (!StringUtils.isEmpty(schemaDir)) {
if (StringUtils.isEmpty(targetNamespace)) { continue;