Example usage for javax.xml.namespace QName getLocalPart

List of usage examples for javax.xml.namespace QName getLocalPart

Introduction

In this page you can find the example usage for javax.xml.namespace QName getLocalPart.

Prototype

public String getLocalPart() 

Source Link

Document

Get the local part of this QName.

Usage

From source file:org.apache.abdera.util.AbstractStreamWriter.java

public StreamWriter writeAttribute(QName qname, String value) {
    if (value == null)
        return this;
    return writeAttribute(qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix(), value);
}

From source file:org.apache.abdera.util.AbstractStreamWriter.java

public StreamWriter startElement(QName qname) {
    return startElement(qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix());
}

From source file:org.apache.abdera.util.AbstractStreamWriter.java

public StreamWriter writeAttribute(QName qname, Date value) {
    return writeAttribute(qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix(), value);
}

From source file:org.apache.abdera.util.AbstractStreamWriter.java

public StreamWriter writeAttribute(QName qname, int value) {
    return writeAttribute(qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix(), value);
}

From source file:org.apache.abdera.util.AbstractStreamWriter.java

public StreamWriter writeAttribute(QName qname, long value) {
    return writeAttribute(qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix(), value);
}

From source file:org.apache.abdera.util.AbstractStreamWriter.java

public StreamWriter writeAttribute(QName qname, double value) {
    return writeAttribute(qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix(), value);
}

From source file:org.apache.abdera2.writer.AbstractStreamWriter.java

public StreamWriter writeAttribute(QName qname, DateTime value) {
    return writeAttribute(qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix(), value);
}

From source file:org.apache.airavata.workflow.model.wf.Workflow.java

private void generateODEScripts(URI dscUrl, String odeEprEndingWithPort)
        throws GraphException, ComponentException {
    this.getGraph().setID(this.getName());

    BPELScript script = null;//  w  w w .j  ava  2s.c  o  m

    script = new BPELScript(this);
    ODEWSDLTransformer wsdlTransformer = new ODEWSDLTransformer();
    script.create(BPELScriptType.BPEL2);
    this.odeProcess = script.getGpelProcess();
    this.odeProcess.setTargetNamespace(WorkflowConstants.LEAD_NS);

    WsdlDefinitions abstractWorkflowWsdl = script.getWorkflowWSDL().getWsdlDefinitions();
    this.odeWorkflowWSDL = abstractWorkflowWsdl;
    try {
        this.odeInvokableWSDL = WSDLUtil.stringToWSDL(abstractWorkflowWsdl.xmlString());
        wsdlTransformer.makeWorkflowWSDLConcrete(this.odeInvokableWSDL, this.getName(), dscUrl);
        wsdlTransformer.setOdeLocation(odeEprEndingWithPort, this.getName(), this.odeInvokableWSDL);

        this.odeWsdlMap = new HashMap<String, WsdlDefinitions>();
        Collection<XmlElement> itr = script.getWSDLs();
        for (XmlElement xmlElement : itr) {
            WsdlDefinitions wsdl = WSDLUtil.stringToWSDL(XmlConstants.BUILDER.serializeToString(xmlElement));
            String id = xmlElement.attributeValue(NS_XWF, ID_ATTRIBUTE);
            if (id == null || id.length() == 0) {
                // xwf up to 2.2.6_2 doesn't have ID.
                id = WSDLUtil.getWSDLQName(wsdl).toString();
                if (null == id || "".equals(id) || (id.startsWith("{") && id.endsWith("}"))) {
                    QName wsdlQname = new QName(NS_XWF.getName(),
                            WSDLUtil.getFirstOperationName(wsdl, WSDLUtil.getFirstPortTypeQName(wsdl)));
                    id = wsdlQname.toString();
                    wsdl.xml().setAttributeValue("name", wsdlQname.getLocalPart());
                }
            }
            WSDLCleaner.cleanWSDL(wsdl);
            this.odeWsdlMap.put(id, wsdl);
        }
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
    }
    new ODEBPELTransformer().generateODEBPEL(this.odeProcess, this.getName(), this.odeWorkflowWSDL,
            this.odeWsdlMap);

    wsdlTransformer.trasnformToODEWsdls(this.getName(), dscUrl, this.odeWorkflowWSDL, this.odeWsdlMap);

    String wsdlString = XMLUtil.xmlElementToString(this.odeWorkflowWSDL.xml());
    this.tridentWSDL = new WsdlDefinitions(XMLUtil.stringToXmlElement(wsdlString));
    new TridentTransformer().process(this.tridentWSDL);

}

From source file:org.apache.axiom.om.impl.llom.OMElementImpl.java

/**
 * It is assumed that the QName passed contains, at least, the localName for this element.
 *
 * @param qname - this should be valid qname according to javax.xml.namespace.QName
 * @throws OMException//  w  w w  . j a va  2s  .  c o m
 */
public OMElementImpl(QName qname, OMContainer parent, OMFactory factory) throws OMException {
    this(qname.getLocalPart(), null, parent, factory);
    this.ns = handleNamespace(qname);
}

From source file:org.apache.axiom.om.impl.llom.OMSourcedElementImpl.java

/**
 * Constructor that takes a QName instead of the local name and the namespace seperately
 *
 * @param qName//from   www.  j a  va  2  s .  c  o m
 * @param factory
 * @param source
 */
public OMSourcedElementImpl(QName qName, OMFactory factory, OMDataSource source) {
    //create a namespace
    super(qName.getLocalPart(), null, factory);
    dataSource = source;
    isExpanded = (dataSource == null);
    if (!isExpanded) {
        if (!isLossyPrefix(dataSource)) {
            // Believe the prefix and create a normal OMNamespace
            definedNamespace = new OMNamespaceImpl(qName.getNamespaceURI(), qName.getPrefix());
        } else {
            // Create a deferred namespace that forces an expand to get the prefix
            definedNamespace = new DeferredNamespace(qName.getNamespaceURI());
        }
    } else {
        definedNamespace = new OMNamespaceImpl(qName.getNamespaceURI(), qName.getPrefix());
    }
}