/** * Retrieves the name of the given element node. * * @param object the context element node * @return Returns the name of the element node. */ public String getElementName(Object object) { return ((OMElement) object).getLocalName(); }
private void readCacheTimeOut(OMElement cacheTimeoutElem, String value) { Integer timeout; try { timeout = Integer.valueOf(value); cacheTimeouts.put(cacheTimeoutElem.getLocalName(), timeout); } catch (NumberFormatException e) { log.warn(cacheTimeoutElem.getLocalName() + "doesn't have a numeric value specified." + "Entry is ignored"); } }
private void readCacheTimeOut(OMElement cacheTimeoutElem, String value) { Integer timeout; try { timeout = Integer.valueOf(value); cacheTimeouts.put(cacheTimeoutElem.getLocalName(), timeout); } catch (NumberFormatException e) { log.warn(cacheTimeoutElem.getLocalName() + "doesn't have a numeric value specified." + "Entry is ignored"); } }
/** * Method serializeStartpart. Serialize the start tag of an element. * * @param element * @param writer * @throws XMLStreamException * @deprecated This is an internal method that is no longer used. */ public static void serializeStartpart(OMElement element, XMLStreamWriter writer) throws XMLStreamException { serializeStartpart(element, element.getLocalName(), writer); }
String getLocalName() { switch (currentEvent) { case START_ELEMENT: case END_ELEMENT: return ((OMElement)node).getLocalName(); case ENTITY_REFERENCE: return ((OMEntityReference)node).getName(); default: throw new IllegalStateException(); } }
/** * This method will check the given OMElement represent either a static property or not * * @param property - OMElement to be checked for the static property * @return boolean true if the elemet represents a static property element false otherwise */ public static boolean isStaticProperty(OMElement property) { return "property".equals(property.getLocalName().toLowerCase()) && (property.getAttributeValue(new QName("expression")) == null); }
public String getFirstElementLocalName() { if (hasLookahead()) { return this.lookAheadLocalName; } else { OMElement element = this.getFirstElement(); if (element == null) { return null; } else { return element.getLocalName(); } } }
/** * This method will check the given OMElement represent either a static property or not * * @param property - OMElement to be checked for the static property * @return boolean true if the elemet represents a static property element false otherwise */ public static boolean isStaticProperty(OMElement property) { return "property".equals(property.getLocalName().toLowerCase()) && (property.getAttributeValue(new QName("expression")) == null); }
public QName getQName(OMElement s) { if (s.getNamespace() == null) { return new QName(s.getLocalName()); } return new QName(s.getNamespace().getNamespaceURI(), s.getLocalName()); } public Map<QName, String> getAttributes(OMElement s) {
private static String loadClaimConfig(OMElement configElement) { StringBuilder claimConfig = new StringBuilder(); Iterator it = configElement.getChildElements(); while (it.hasNext()) { OMElement element = (OMElement) it.next(); if ("Claim".equals(element.getLocalName())) { claimConfig.append(element.getText()); } } return claimConfig.toString(); } }
public static ApplicationPermission build(OMElement applicationPermissionOM) { ApplicationPermission applicationPermission = new ApplicationPermission(); Iterator<?> iter = applicationPermissionOM.getChildElements(); while (iter.hasNext()) { OMElement element = (OMElement) (iter.next()); String elementName = element.getLocalName(); if ("value".equals(elementName)) { applicationPermission.setValue(element.getText()); } } return applicationPermission; }
@SuppressWarnings("unchecked") private static OMElement stripNamespace(OMElement element) { OMElement parent = OM.createOMElement(new QName("", element.getLocalName())); Iterator<OMElement> iter = (Iterator<OMElement>) element.getChildElements(); while (iter.hasNext()) { OMElement child = iter.next(); child = child.cloneOMElement(); parent.addChild(child); } return parent; }
public RESTMessage decode(ContentType contentType, AxisMessage message) throws Exception { List<Parameter> parameters = new LinkedList<Parameter>(); OMElement content = message.getEnvelope().getBody().getFirstElement(); for (Iterator<?> it = content.getChildElements(); it.hasNext(); ) { OMElement child = (OMElement)it.next(); parameters.add(new Parameter(child.getLocalName(), child.getText())); } return new RESTMessage(parameters.toArray(new Parameter[parameters.size()])); } };
void initializeConfigs(OMElement mappingsElement) { if (mappingsElement == null) { return; } if (mappingsElement.getLocalName().equals("Server")) { mappingsElement = mappingsElement.getFirstChildWithName(AUTH_CTX_QNAME); } OMElement amrRefsElement = mappingsElement.getFirstChildWithName(AMR_MAPPING_QNAME); if (amrRefsElement != null) { processAmrMappings(amrRefsElement); } }
@Override public Object wrap(OMElement template, OMElement os) { OMElement wrapper; if (os != null) { OMNamespace ns = os.declareNamespace(template.getNamespace().getNamespaceURI(), ""); wrapper = factory.createOMElement(template.getLocalName(), ns); wrapper.addChild(os); } else { wrapper = template.cloneOMElement(); } return wrapper; }
public static Analyzer getAnalyzerObject(OMElement analyzerEl) throws AnalyzerException { String name = analyzerEl.getLocalName(); Analyzer analyzer = null; if (getAnalyzerBuilderMap().containsKey(name)) { analyzer = getAnalyzerBuilderMap().get(name).buildAnalyzer(analyzerEl); } else { throw new AnalyzerException("Analyzer with name " + name + " not present.."); } return analyzer; }
protected void assertEchoResponse(String textValue, OMElement element) { assertEquals("echoOMElementResponse", element.getLocalName()); assertEquals("http://localhost/axis2/services/EchoXMLService", element.getNamespace().getNamespaceURI()); OMElement valueElement = element.getFirstElement(); assertEquals("myValue", valueElement.getLocalName()); assertEquals("http://localhost/axis2/services/EchoXMLService", valueElement.getNamespace().getNamespaceURI()); assertEquals(textValue, valueElement.getText()); }
/** * Get target resource from context. * * @param tag * the tag * @param context * the context * @return the resource, null if not found. */ protected PaxmlResource getTargetResource(FileInvokerTag tag, IParserContext context) { return context.getLocator().getResource(context.getElement().getLocalName()); }
public static Accept fromOM(OMElement omElement) throws RMMessageBuildingException { String rmNamesapce = omElement.getNamespace().getNamespaceURI(); OMElement acksTo = omElement.getFirstElement(); if (!acksTo.getLocalName().equals(MercuryConstants.ACKS_TO)){ throw new RMMessageBuildingException("Can not Address element in AcksTo element"); } Accept accept = new Accept(rmNamesapce); accept.setAcceptERP(AcksTo.fromOM(acksTo).getEndpointAddress()); return accept; }
private ServiceClient configureServiceClientForSubscription(OMElement message) throws AxisFault { String soapAction = message.getNamespace().getNamespaceURI() + "/" + message.getLocalName(); Options opts = CommonRoutines.getOptions(soapAction, getTimeoutInMilliSeconds(), brokerEndpointRef); ServiceClient client = new ServiceClient(); client.setOptions(opts); CommonRoutines.setHeaders(soapAction, brokerEndpointRef.getAddress(), client); return client; }