List of usage examples for javax.xml.namespace QName getLocalPart
public String getLocalPart()
Get the local part of this QName
.
From source file:com.evolveum.midpoint.provisioning.ucf.impl.ConnectorInstanceIcfImpl.java
private void transformConnectorPoolConfiguration(ObjectPoolConfiguration connectorPoolConfiguration, PrismContainer<?> connectorPoolContainer) throws SchemaException { if (connectorPoolContainer == null || connectorPoolContainer.getValue() == null) { return;//w ww . j av a 2 s .com } for (PrismProperty prismProperty : connectorPoolContainer.getValue().getProperties()) { QName propertyQName = prismProperty.getElementName(); if (propertyQName.getNamespaceURI().equals(ConnectorFactoryIcfImpl.NS_ICF_CONFIGURATION)) { String subelementName = propertyQName.getLocalPart(); if (ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_MIN_EVICTABLE_IDLE_TIME_MILLIS .equals(subelementName)) { connectorPoolConfiguration.setMinEvictableIdleTimeMillis(parseLong(prismProperty)); } else if (ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_MIN_IDLE .equals(subelementName)) { connectorPoolConfiguration.setMinIdle(parseInt(prismProperty)); } else if (ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_MAX_IDLE .equals(subelementName)) { connectorPoolConfiguration.setMaxIdle(parseInt(prismProperty)); } else if (ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_MAX_OBJECTS .equals(subelementName)) { connectorPoolConfiguration.setMaxObjects(parseInt(prismProperty)); } else if (ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_MAX_WAIT .equals(subelementName)) { connectorPoolConfiguration.setMaxWait(parseLong(prismProperty)); } else { throw new SchemaException("Unexpected element " + propertyQName + " in " + ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_XML_ELEMENT_NAME); } } else { throw new SchemaException("Unexpected element " + propertyQName + " in " + ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_CONNECTOR_POOL_CONFIGURATION_XML_ELEMENT_NAME); } } }
From source file:com.evolveum.midpoint.provisioning.ucf.impl.ConnectorInstanceIcfImpl.java
private void transformResultsHandlerConfiguration(ResultsHandlerConfiguration resultsHandlerConfiguration, PrismContainer<?> resultsHandlerConfigurationContainer) throws SchemaException { if (resultsHandlerConfigurationContainer == null || resultsHandlerConfigurationContainer.getValue() == null) { return;//from www.j a v a 2 s. co m } for (PrismProperty prismProperty : resultsHandlerConfigurationContainer.getValue().getProperties()) { QName propertyQName = prismProperty.getElementName(); if (propertyQName.getNamespaceURI().equals(ConnectorFactoryIcfImpl.NS_ICF_CONFIGURATION)) { String subelementName = propertyQName.getLocalPart(); if (ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_ENABLE_NORMALIZING_RESULTS_HANDLER .equals(subelementName)) { resultsHandlerConfiguration.setEnableNormalizingResultsHandler(parseBoolean(prismProperty)); } else if (ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_ENABLE_FILTERED_RESULTS_HANDLER .equals(subelementName)) { resultsHandlerConfiguration.setEnableFilteredResultsHandler(parseBoolean(prismProperty)); } else if (ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_FILTERED_RESULTS_HANDLER_IN_VALIDATION_MODE .equals(subelementName)) { resultsHandlerConfiguration .setFilteredResultsHandlerInValidationMode(parseBoolean(prismProperty)); } else if (ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_ENABLE_CASE_INSENSITIVE_HANDLER .equals(subelementName)) { resultsHandlerConfiguration.setEnableCaseInsensitiveFilter(parseBoolean(prismProperty)); } else if (ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_ENABLE_ATTRIBUTES_TO_GET_SEARCH_RESULTS_HANDLER .equals(subelementName)) { resultsHandlerConfiguration .setEnableAttributesToGetSearchResultsHandler(parseBoolean(prismProperty)); } else { throw new SchemaException("Unexpected element " + propertyQName + " in " + ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_ELEMENT_LOCAL_NAME); } } else { throw new SchemaException("Unexpected element " + propertyQName + " in " + ConnectorFactoryIcfImpl.CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_ELEMENT_LOCAL_NAME); } } }
From source file:com.nortal.jroad.typegen.xmlbeans.XteeSchemaCodePrinter.java
void printSetterImpls(QName qName, boolean isAttr, String propertyName, int javaType, String type, String xtype, boolean nillable, boolean optional, boolean several, boolean singleton, boolean isunion, String identifier, String setIdentifier, SchemaType sType) throws IOException { String safeVarName = NameUtil.nonJavaKeyword(NameUtil.lowerCamelCase(propertyName)); if (safeVarName.equals("i")) safeVarName = "iValue"; else if (safeVarName.equals("target")) safeVarName = "targetValue"; boolean xmltype = (javaType == SchemaProperty.XML_OBJECT); boolean isobj = (javaType == SchemaProperty.JAVA_OBJECT); boolean isSubstGroup = identifier != setIdentifier; String jSet = jsetMethod(javaType); String jtargetType = (isunion || !xmltype) ? "org.apache.xmlbeans.SimpleValue" : xtype; String propdesc = "\"" + qName.getLocalPart() + "\"" + (isAttr ? " attribute" : " element"); if (singleton) { // void setProp(Value v); printJavaDoc((several ? "Sets first " : "Sets the ") + propdesc); emit("public void set" + propertyName + "(" + type + " " + safeVarName + ")"); startBlock();/*from w w w. j a v a2s .co m*/ emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, several ? "0" : "-1"); emitGetTarget(setIdentifier, identifier, isAttr, "0", ADD_NEW_VALUE, jtargetType); emit(jSet + "(" + safeVarName + ");"); emitPost(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, several ? "0" : "-1"); emitImplementationPostamble(); endBlock(); if (!xmltype) { // void xsetProp(Value v) printJavaDoc((several ? "Sets (as xml) first " : "Sets (as xml) the ") + propdesc); emit("public void xset" + propertyName + "(" + xtype + " " + safeVarName + ")"); startBlock(); emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, several ? "0" : "-1"); emitGetTarget(setIdentifier, identifier, isAttr, "0", ADD_NEW_VALUE, xtype); emit("target.set(" + safeVarName + ");"); emitPost(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, several ? "0" : "-1"); emitImplementationPostamble(); endBlock(); } if (xmltype && !several) { // Value addNewProp() printJavaDoc("Appends and returns a new empty " + propdesc); emit("public " + xtype + " addNew" + propertyName + "()"); startBlock(); emitImplementationPreamble(); emitDeclareTarget(true, xtype); emitPre(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr); emitAddTarget(identifier, isAttr, true, xtype); emitPost(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr); emit("return target;"); emitImplementationPostamble(); endBlock(); } if (nillable) { printJavaDoc((several ? "Nils the first " : "Nils the ") + propdesc); emit("public void setNil" + propertyName + "()"); startBlock(); emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, several ? "0" : "-1"); emitGetTarget(setIdentifier, identifier, isAttr, "0", ADD_NEW_VALUE, xtype); emit("target.setNil();"); emitPost(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, several ? "0" : "-1"); emitImplementationPostamble(); endBlock(); } } if (optional) { printJavaDoc((several ? "Removes first " : "Unsets the ") + propdesc); emit("public void unset" + propertyName + "()"); startBlock(); emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_REMOVE, identifier, isAttr, several ? "0" : "-1"); if (isAttr) emit("get_store().remove_attribute(" + identifier + ");"); else emit("get_store().remove_element(" + setIdentifier + ", 0);"); emitPost(sType, PrePostExtension.OPERATION_REMOVE, identifier, isAttr, several ? "0" : "-1"); emitImplementationPostamble(); endBlock(); } if (several) { String arrayName = propertyName + "Array"; // JSET_INDEX printJavaDoc("Sets array of all " + propdesc); emit("public void set" + arrayName + "(" + type + "[] " + safeVarName + "Array)"); startBlock(); emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr); if (isobj) { if (!isSubstGroup) emit("unionArraySetterHelper(" + safeVarName + "Array" + ", " + identifier + ");"); else emit("unionArraySetterHelper(" + safeVarName + "Array" + ", " + identifier + ", " + setIdentifier + ");"); } else { if (!isSubstGroup) emit("arraySetterHelper(" + safeVarName + "Array" + ", " + identifier + ");"); else emit("arraySetterHelper(" + safeVarName + "Array" + ", " + identifier + ", " + setIdentifier + ");"); } emitPost(sType, PrePostExtension.OPERATION_SET, identifier, isAttr); emitImplementationPostamble(); endBlock(); printJavaDoc("Sets ith " + propdesc); emit("public void set" + arrayName + "(int i, " + type + " " + safeVarName + ")"); startBlock(); emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, "i"); emitGetTarget(setIdentifier, identifier, isAttr, "i", THROW_EXCEPTION, jtargetType); emit(jSet + "(" + safeVarName + ");"); emitPost(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, "i"); emitImplementationPostamble(); endBlock(); if (!xmltype) { printJavaDoc("Sets (as xml) array of all " + propdesc); emit("public void xset" + arrayName + "(" + xtype + "[]" + safeVarName + "Array)"); startBlock(); emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr); emit("arraySetterHelper(" + safeVarName + "Array" + ", " + identifier + ");"); emitPost(sType, PrePostExtension.OPERATION_SET, identifier, isAttr); emitImplementationPostamble(); endBlock(); printJavaDoc("Sets (as xml) ith " + propdesc); emit("public void xset" + arrayName + "(int i, " + xtype + " " + safeVarName + ")"); startBlock(); emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, "i"); emitGetTarget(setIdentifier, identifier, isAttr, "i", THROW_EXCEPTION, xtype); emit("target.set(" + safeVarName + ");"); emitPost(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, "i"); emitImplementationPostamble(); endBlock(); } if (nillable) { printJavaDoc("Nils the ith " + propdesc); emit("public void setNil" + arrayName + "(int i)"); startBlock(); emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, "i"); emitGetTarget(setIdentifier, identifier, isAttr, "i", THROW_EXCEPTION, xtype); emit("target.setNil();"); emitPost(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, "i"); emitImplementationPostamble(); endBlock(); } if (!xmltype) { printJavaDoc("Inserts the value as the ith " + propdesc); emit("public void insert" + propertyName + "(int i, " + type + " " + safeVarName + ")"); startBlock(); emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr, "i"); emit(jtargetType + " target = "); indent(); if (!isSubstGroup) emit("(" + jtargetType + ")get_store().insert_element_user(" + identifier + ", i);"); else // This is a subst group case emit("(" + jtargetType + ")get_store().insert_element_user(" + setIdentifier + ", " + identifier + ", i);"); outdent(); emit(jSet + "(" + safeVarName + ");"); emitPost(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr, "i"); emitImplementationPostamble(); endBlock(); printJavaDoc("Appends the value as the last " + propdesc); emit("public void add" + propertyName + "(" + type + " " + safeVarName + ")"); startBlock(); emitImplementationPreamble(); emitDeclareTarget(true, jtargetType); emitPre(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr); emitAddTarget(identifier, isAttr, true, jtargetType); emit(jSet + "(" + safeVarName + ");"); emitPost(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr); emitImplementationPostamble(); endBlock(); } printJavaDoc("Inserts and returns a new empty value (as xml) as the ith " + propdesc); emit("public " + xtype + " insertNew" + propertyName + "(int i)"); startBlock(); emitImplementationPreamble(); emitDeclareTarget(true, xtype); emitPre(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr, "i"); if (!isSubstGroup) { emit("target = (" + xtype + ")get_store().insert_element_user(" + identifier + ", i);"); } else // This is a subst group case { emit("target = (" + xtype + ")get_store().insert_element_user(" + setIdentifier + ", " + identifier + ", i);"); } emitPost(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr, "i"); emit("return target;"); emitImplementationPostamble(); endBlock(); printJavaDoc("Appends and returns a new empty value (as xml) as the last " + propdesc); emit("public " + xtype + " addNew" + propertyName + "()"); startBlock(); emitImplementationPreamble(); emitDeclareTarget(true, xtype); emitPre(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr); emitAddTarget(identifier, isAttr, true, xtype); emitPost(sType, PrePostExtension.OPERATION_INSERT, identifier, isAttr); emit("return target;"); emitImplementationPostamble(); endBlock(); printJavaDoc("Removes the ith " + propdesc); emit("public void remove" + propertyName + "(int i)"); startBlock(); emitImplementationPreamble(); emitPre(sType, PrePostExtension.OPERATION_REMOVE, identifier, isAttr, "i"); emit("get_store().remove_element(" + setIdentifier + ", i);"); emitPost(sType, PrePostExtension.OPERATION_REMOVE, identifier, isAttr, "i"); emitImplementationPostamble(); endBlock(); } }
From source file:com.evolveum.midpoint.provisioning.ucf.impl.ConnectorInstanceIcfImpl.java
private void transformConnectorConfiguration(ConfigurationProperties configProps, PrismContainer<?> configurationPropertiesContainer, String connectorConfNs) throws ConfigurationException, SchemaException { if (configurationPropertiesContainer == null || configurationPropertiesContainer.getValue() == null) { throw new SchemaException("No configuration properties container in " + connectorType); }/*from ww w . j av a 2 s.co m*/ int numConfingProperties = 0; List<QName> wrongNamespaceProperties = new ArrayList<>(); for (PrismProperty prismProperty : configurationPropertiesContainer.getValue().getProperties()) { QName propertyQName = prismProperty.getElementName(); // All the elements must be in a connector instance // namespace. if (propertyQName.getNamespaceURI() == null || !propertyQName.getNamespaceURI().equals(connectorConfNs)) { LOGGER.warn("Found element with a wrong namespace ({}) in {}", propertyQName.getNamespaceURI(), connectorType); wrongNamespaceProperties.add(propertyQName); } else { numConfingProperties++; // Local name of the element is the same as the name // of ICF configuration property String propertyName = propertyQName.getLocalPart(); ConfigurationProperty property = configProps.getProperty(propertyName); if (property == null) { throw new ConfigurationException("Unknown configuration property " + propertyName); } // Check (java) type of ICF configuration property, // behave accordingly Class<?> type = property.getType(); if (type.isArray()) { property.setValue(convertToIcfArray(prismProperty, type.getComponentType())); // property.setValue(prismProperty.getRealValuesArray(type.getComponentType())); } else { // Single-valued property are easy to convert property.setValue(convertToIcfSingle(prismProperty, type)); // property.setValue(prismProperty.getRealValue(type)); } } } // empty configuration is OK e.g. when creating a new resource using wizard if (numConfingProperties == 0 && !wrongNamespaceProperties.isEmpty()) { throw new SchemaException("No configuration properties found. Wrong namespace? (expected: " + connectorConfNs + ", present e.g. " + wrongNamespaceProperties.get(0) + ")"); } }
From source file:nl.cyso.vcloud.client.vCloudClient.java
public Task resizeVMDisks(String org, String vdc, String vapp, String vm, String diskname, BigInteger disksize) {/* w w w . ja v a2 s .co m*/ this.vccPreCheck(); Task t = null; try { VM vmObj = this.getVM(org, vdc, vapp, vm); int length = 0; try { length = vmObj.getVMDiskChainLength(); } catch (NullPointerException ne) { Formatter.printErrorLine( "Could not retrieve VM disk chain length. Operation will continue, but may fail."); } if (length > 1) { Formatter.printErrorLine( "VM has a disk chain length larger than one. This VM needs to be consolidated before the disk can be extended."); System.exit(1); } List<VirtualDisk> disks = vmObj.getDisks(); List<VirtualDisk> newDisks = new ArrayList<VirtualDisk>(disks.size()); for (VirtualDisk disk : disks) { if (disk.isHardDisk()) { RASDType d = new RASDType(); d.setElementName(disk.getItemResource().getElementName()); d.setResourceType(disk.getItemResource().getResourceType()); d.setInstanceID(disk.getItemResource().getInstanceID()); for (int i = 0; i < disk.getItemResource().getHostResource().size(); i++) { CimString resource = disk.getItemResource().getHostResource().get(i); d.getHostResource().add(resource); if (disk.getItemResource().getElementName().getValue().equals(diskname)) { if (disk.getHardDiskSize().compareTo(disksize) == 1) { throw new VCloudException( "Failed to resize disk, shrinking disks is not supported"); } for (QName key : resource.getOtherAttributes().keySet()) { if (key.getLocalPart().equals("capacity")) { resource.getOtherAttributes().put(key, disksize.toString()); } } } } newDisks.add(new VirtualDisk(d)); } } t = vmObj.updateDisks(newDisks); } catch (VCloudException e) { Formatter.printErrorLine("An error occured while resizing disks"); Formatter.printErrorLine(e.getLocalizedMessage()); Formatter.printStackTrace(e); System.exit(1); } return t; }
From source file:nl.meertens.cmdi.FindProfiles.java
public static void main(String[] args) throws FileNotFoundException { Boolean debug = false;/*from w ww . j a v a 2 s. com*/ Boolean verbose = false; String dir = "."; String ext = "cmdi"; // check command line OptionParser parser = new OptionParser("dve:?*"); OptionSet options = parser.parse(args); if (options.has("d")) debug = true; if (options.has("v")) verbose = true; if (options.has("e")) ext = (String) options.valueOf("e"); if (options.has("?")) { showHelp(); System.exit(0); } List arg = options.nonOptionArguments(); if (arg.size() > 1) { System.err.println("!FTL: only one source <DIR> argument is allowed!"); showHelp(); System.exit(1); } if (arg.size() == 1) dir = (String) arg.get(0); Set<String> profiles = new HashSet<String>(); Pattern cr_rest = Pattern.compile("^.*" + CR_URI + "rest/registry/profiles/", Pattern.DOTALL); Pattern cr_ext = Pattern.compile("/xsd.*$", Pattern.DOTALL); XMLInputFactory2 xmlif = (XMLInputFactory2) XMLInputFactory2.newInstance(); xmlif.configureForConvenience(); Collection<File> inputs = FileUtils.listFiles(new File(dir), new String[] { ext }, true); int e = 0; int i = 0; int s = inputs.size(); for (File input : inputs) { i++; if (verbose) System.err.println("?INF: " + i + "/" + s + ": " + input); int state = START; int sdepth = 0; int depth = 0; XMLStreamReader2 xmlr = null; FileInputStream in = null; String profile = null; try { in = new FileInputStream(input); xmlr = (XMLStreamReader2) xmlif.createXMLStreamReader(in); while (state != STOP && state != ERROR) { int eventType = xmlr.getEventType(); QName qn = null; switch (eventType) { case XMLEvent2.START_ELEMENT: depth++; qn = xmlr.getName(); break; case XMLEvent2.END_ELEMENT: qn = xmlr.getName(); break; } switch (state) { case START: switch (eventType) { case XMLEvent2.START_ELEMENT: if (qn.getNamespaceURI().equals(CMD_NS) && qn.getLocalPart().equals("CMD")) { state = OPEN_CMD; sdepth = depth; String prof = xmlr.getAttributeValue(XSI_NS, "schemaLocation"); if (prof != null) { if (prof.contains(CR_URI)) { prof = cr_rest.matcher(prof).replaceFirst(""); prof = cr_ext.matcher(prof).replaceFirst(""); profile = prof; if (verbose || debug) System.out.println("?" + (debug ? "DBG" : "INF") + ": " + input + ": xsi:schemaLocation[" + prof + "]"); } else System.err.println("!WRN: " + input + ": xsi:schemaLocation[" + prof + "] doesn't contain a reference to a CMD profile in CR!"); } } else { System.err.println("!ERR: " + input + ": no cmd:CMD root found!"); state = ERROR; } break; case XMLEvent2.END_DOCUMENT: System.err.println("!ERR: " + input + ": no XML content found!"); state = ERROR; break; } break; case OPEN_CMD: switch (eventType) { case XMLEvent2.START_ELEMENT: if (qn.getNamespaceURI().equals(CMD_NS) && qn.getLocalPart().equals("Header")) { state = OPEN_HEADER; sdepth = depth; } else { System.err.println("!ERR: " + input + ": no cmd:CMD/cmd:Header found!"); state = ERROR; } break; case XMLEvent2.END_ELEMENT: if (qn.getNamespaceURI().equals(CMD_NS) && qn.getLocalPart().equals("CMD") && sdepth == depth) { System.err.println("!ERR: " + input + ": no cmd:CMD/cmd:Header found!"); state = ERROR; } break; } break; case OPEN_HEADER: switch (eventType) { case XMLEvent2.START_ELEMENT: if (qn.getNamespaceURI().equals(CMD_NS) && qn.getLocalPart().equals("MdProfile") && sdepth + 1 == depth) { state = OPEN_MDPROFILE; } break; case XMLEvent2.END_ELEMENT: if (qn.getNamespaceURI().equals(CMD_NS) && qn.getLocalPart().equals("Header") && sdepth == depth) { System.err.println("!" + (profile == null ? "ERR" : "WRN") + ": " + input + ": no cmd:CMD/cmd:Header/cmd:MdProfile found!"); state = ERROR; } break; } break; case OPEN_MDPROFILE: switch (eventType) { case XMLEvent2.CHARACTERS: String prof = xmlr.getText(); prof = cr_rest.matcher(prof).replaceFirst(""); prof = cr_ext.matcher(prof).replaceFirst(""); if (verbose || debug) System.out.println( "?" + (debug ? "DBG" : "INF") + ": " + input + ": MdProfile[" + prof + "]"); if (profile == null) profile = prof; else if (!prof.equals(profile)) System.out.println("!WRN: " + input + ": MdProfile[" + prof + "] and xsi:schemaLocation[" + profile + "] contradict!"); state = STOP; break; default: state = STOP; break; } break; } switch (eventType) { case XMLEvent2.END_ELEMENT: depth--; break; } eventType = xmlr.next(); } } catch (Exception ex) { System.err.println("!ERR: " + input + ": " + ex); ex.printStackTrace(System.err); state = ERROR; } finally { try { xmlr.close(); in.close(); } catch (Exception ex) { System.err.println("!ERR: " + input + ": " + ex); ex.printStackTrace(System.err); state = ERROR; } } if (profile != null) profiles.add(profile); if (state == ERROR) e++; } for (String profile : profiles) { System.out.println(profile); } System.exit(e); }
From source file:nl.nn.adapterframework.soap.Wsdl.java
protected void message(XMLStreamWriter w, String root, Collection<QName> parts) throws XMLStreamException, IOException { if (!parts.isEmpty()) { w.writeStartElement(WSDL_NAMESPACE, "message"); w.writeAttribute("name", "Message_" + root); {//from w w w. j a v a 2s.com for (QName part : parts) { w.writeEmptyElement(WSDL_NAMESPACE, "part"); w.writeAttribute("name", "Part_" + part.getLocalPart()); String type = part.getPrefix() + ":" + part.getLocalPart(); w.writeAttribute("element", type); } } w.writeEndElement(); } }
From source file:nl.nn.adapterframework.soap.Wsdl.java
protected void writeSoapHeader(XMLStreamWriter w, String root, QName headerElement, boolean isHeaderOptional) throws XMLStreamException, IOException { if (headerElement != null) { w.writeEmptyElement(soapNamespace, "header"); w.writeAttribute("part", "Part_" + headerElement.getLocalPart()); w.writeAttribute("use", "literal"); w.writeAttribute("message", getTargetNamespacePrefix() + ":" + "Message_" + root + (isHeaderOptional ? "_" + headerElement.getLocalPart() : "")); }/*www. j ava 2 s . c o m*/ }
From source file:nl.nn.adapterframework.soap.Wsdl.java
protected void writeSoapBody(XMLStreamWriter w, QName bodyElement) throws XMLStreamException, IOException { if (bodyElement != null) { w.writeEmptyElement(soapNamespace, "body"); w.writeAttribute("parts", "Part_" + bodyElement.getLocalPart()); w.writeAttribute("use", "literal"); }//w ww . j a v a2 s . co m }
From source file:nz.org.take.r2ml.util.ReplacePropertyFunctionTermFilter.java
private String generateVarName(QName propertyName) { Integer i = propertyNames.get(propertyName); if (i == null) { i = 0;/*from w w w .j a v a 2 s. c o m*/ } propertyNames.put(propertyName, ++i); return propertyName.getLocalPart() + i; }