private String getValueOfElementWithLocalName(OMElement element, String localName) { Iterator iterator = element.getChildrenWithLocalName(localName); String value = null; Object obj = iterator.next(); if (obj instanceof OMElement) { value = ((OMElement) obj).getText(); } return value; }
private static String getCustomQuery(OMElement queryEl) { return ((OMElement) queryEl.getChildrenWithLocalName( DBSFields.EXPRESSION).next()).getText(); }
private void parseRequiredHeaderClaimUris(OMElement requiredClaimUrisElem) { if (requiredClaimUrisElem == null) { return; } Iterator claimUris = requiredClaimUrisElem.getChildrenWithLocalName(CLAIM_URI); if (claimUris != null) { while (claimUris.hasNext()) { OMElement claimUri = (OMElement) claimUris.next(); if (claimUri != null) { requiredHeaderClaimUris.add(claimUri.getText()); } } } }
private void buildSupertypes(OMElement omElement) throws ConstraintViolationException { Iterator supertypeIt = omElement.getChildrenWithLocalName("supertypes"); while (supertypeIt.hasNext()) { //one time process OMElement supertypes = (OMElement) supertypeIt.next(); Iterator it1 = supertypes.getChildrenWithLocalName("supertype"); List<String> superTypeList = new ArrayList<String>(); while (it1.hasNext()) { superTypeList.add(((OMElement) it1.next()).getText()); //super types } nodeTypeTemplate.setDeclaredSuperTypeNames(superTypeList.toArray(new String[0])); } }
/** * Construct from owning elements with local name filter. * * @param ele * the owning element * @param filter * the local name filter */ public Elements(final OMElement ele, final String filter) { super(filter == null ? ele.getChildElements() : ele.getChildrenWithLocalName(filter)); }
public void setString(String name, String value) { Iterator<OMElement> el = target.getChildrenWithLocalName(name); if (value == null) { throw new IllegalArgumentException(); } else { while (el.hasNext()) el.next().setText(value); return; } }
/** * Construct from owning elements with local name filter. * * @param ele * the owning element * @param filter * the local name filter */ public Elements(final OMElement ele, final String filter) { super(filter == null ? ele.getChildElements() : ele.getChildrenWithLocalName(filter)); }
protected void parseExclusions(OMElement part) { excludeUids = new HashSet<String>(); Iterator<OMElement> it = part.getChildrenWithLocalName("Exclude"); while (it.hasNext()) { OMElement e = it.next(); String s = e.getAttributeValue(new QName("value")); if (s != null) { excludeUids.add(s); } } }
public void saveResources(OMElement resourcesElement, String basePath) throws JaxenException, RegistryException { Iterator<OMElement> resources = resourcesElement.getChildrenWithLocalName("resource"); while (resources.hasNext()){ String resourcePath = RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + addResource(resources.next(), basePath); if (resourcePath != null){ addDependency(wadlPath, resourcePath); } } }
private String exctractConditionFromPolicyPartialContent(String policyPartialContent){ try { StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(policyPartialContent.getBytes())); OMElement conditionNode = (OMElement) builder.getDocumentElement().getChildrenWithLocalName("Condition").next(); return conditionNode.toString(); } catch (XMLStreamException e) { log.error("Can't extract the 'Condition' node from the 'Rule' node.", e); return null; } }
private void storeFiles(OMElement respBody, Path dirPath) throws Exception { Iterator <OMElement> docRespEles = respBody.getChildrenWithLocalName("DocumentResponse"); while (docRespEles.hasNext()) { OMElement docRespEle = docRespEles.next(); String docUID = XmlUtil.onlyChildWithLocalName(docRespEle, "DocumentUniqueId").getText(); OMElement docEle = XmlUtil.onlyChildWithLocalName(docRespEle, "Document"); String txt = docEle.getText(); BASE64Decoder d = new BASE64Decoder(); byte[] contents = d.decodeBuffer(txt); File dcmFile = dirPath.resolve(docUID + ".dcm").toFile(); FileUtils.writeByteArrayToFile(dcmFile, contents); } }
private void parseIds(Map<String, String> map, String section) { List<OMElement> idEles = XmlUtil.decendentsWithLocalName(root, section); for (OMElement e : idEles) { for (Iterator i = e.getChildrenWithLocalName("Assign"); i.hasNext(); ) { OMElement a = (OMElement) i.next(); String symbol = a.getAttributeValue(symbolQ); String id = a.getAttributeValue(idQ); map.put(symbol, id); } } }
private void readAuthenticatorNameMappings(OMElement documentElement) { OMElement authenticatorNameMappingsElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil. getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_AUTHENTICATOR_NAME_MAPPINGS)); if (authenticatorNameMappingsElem != null) { for (Iterator authenticatorNameMappingElems = authenticatorNameMappingsElem.getChildrenWithLocalName(FrameworkConstants.Config.ELEM_AUTHENTICATOR_NAME_MAPPING); authenticatorNameMappingElems.hasNext(); ) { processAuthenticatorNameMappingElement((OMElement) authenticatorNameMappingElems.next()); } } }
private void readAuthenticatorNameMappings(OMElement documentElement) { OMElement authenticatorNameMappingsElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil. getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_AUTHENTICATOR_NAME_MAPPINGS)); if (authenticatorNameMappingsElem != null) { for (Iterator authenticatorNameMappingElems = authenticatorNameMappingsElem.getChildrenWithLocalName(FrameworkConstants.Config.ELEM_AUTHENTICATOR_NAME_MAPPING); authenticatorNameMappingElems.hasNext(); ) { processAuthenticatorNameMappingElement((OMElement) authenticatorNameMappingElems.next()); } } }
private void readSequenceConfigs(OMElement documentElement) { OMElement sequencesElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil. getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_SEQUENCES)); if (sequencesElem != null) { // for each every application defined, create a ApplicationBean instance for (Iterator sequenceElements = sequencesElem.getChildrenWithLocalName(FrameworkConstants.Config.ELEM_SEQUENCE); sequenceElements.hasNext(); ) { SequenceConfig sequenceConfig = processSequenceElement((OMElement) sequenceElements.next()); if (sequenceConfig != null) { this.sequenceList.add(sequenceConfig); } } } }
public Object readObject(Parameter param, boolean client) throws Exception { Iterator iterator = currentNode.getChildrenWithLocalName(param.getName()); if (!iterator.hasNext()) { return null; } return readObject(param.getParameterType(), (OMElement)iterator.next(), client); }
private void readAuthenticatorNameMappings(OMElement documentElement) { OMElement authenticatorNameMappingsElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil. getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_AUTHENTICATOR_NAME_MAPPINGS)); if (authenticatorNameMappingsElem != null) { for (Iterator authenticatorNameMappingElems = authenticatorNameMappingsElem.getChildrenWithLocalName(FrameworkConstants.Config.ELEM_AUTHENTICATOR_NAME_MAPPING); authenticatorNameMappingElems.hasNext(); ) { processAuthenticatorNameMappingElement((OMElement) authenticatorNameMappingElems.next()); } } }
private static void processTransports(OMElement root, Transport[] transports, String localName) { if (transports == null) { return; } for (Transport transport : transports) { for (Iterator<OMElement> it = root.getChildrenWithLocalName(localName); it.hasNext(); ) { OMElement transportElement = it.next(); if (transportElement.getAttributeValue(new QName("name")).equals(transport.getName())) { applyParameters(transportElement, transport.getParameters()); } } } }
private void readAuthenticatorConfigs(OMElement documentElement) { OMElement authenticatorConfigsElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil. getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_AUTHENTICATOR_CONFIGS)); if (authenticatorConfigsElem != null) { // for each and every authenticator defined, create an AuthenticatorConfig instance for (Iterator authenticatorConfigElements = authenticatorConfigsElem.getChildrenWithLocalName(FrameworkConstants.Config.ELEM_AUTHENTICATOR_CONFIG); authenticatorConfigElements.hasNext(); ) { AuthenticatorConfig authenticatorConfig = processAuthenticatorConfigElement((OMElement) authenticatorConfigElements.next()); if (authenticatorConfig != null) { this.authenticatorConfigMap.put(authenticatorConfig.getName(), authenticatorConfig); } } } }
private void parseCodes(OMElement rawCodeType, Codes codes) { Iterator codeIterator = rawCodeType.getChildrenWithLocalName("Code"); while (codeIterator.hasNext()) { Object obj = codeIterator.next(); if (!(obj instanceof OMElement)) continue; OMElement rawCode = (OMElement) obj; String codeString = rawCode.getAttributeValue(codeQname); String displayString = rawCode.getAttributeValue(displayQname); String codingSchemeString = rawCode.getAttributeValue(codingSchemeQname); Code code = new Code(codeString, codingSchemeString, displayString); codes.add(code); } }