Package org.apache.axis2.om

Examples of org.apache.axis2.om.OMAttribute


    public void populateModule() throws DeploymentException {
        try {
            OMElement moduleElement = buildOM();

            // Setting Module Name
            OMAttribute moduleNameAtt = moduleElement.getAttribute(
                    new QName(ATTNAME));
            if(moduleNameAtt != null){
                String moduleName = moduleNameAtt.getValue();
                if (moduleName != null && !"".equals(moduleName)) {
                    module.setName(new QName(moduleName));
                } else {
                    module.setName(new QName(getShortFileName(engine.getCurrentFileItem()
                            .getServiceName())));
                }
            }else {
                module.setName(new QName(getShortFileName(engine.getCurrentFileItem()
                        .getServiceName())));
            }

            // Setting Module Class , if it is there
            OMAttribute moduleClassAtt = moduleElement.getAttribute(
                    new QName(CLASSNAME));
            if(moduleClassAtt !=null){
                String moduleClass = moduleClassAtt.getValue();
                if(moduleClass !=null && !"".equals(moduleClass)){
                    if (engine !=null) {
                        engine.getCurrentFileItem().setModuleClass(moduleClass);
                    }
                }
View Full Code Here


        ArrayList operations = new ArrayList();
        while (opeartinsItr.hasNext()) {
            OMElement operation = (OMElement) opeartinsItr.next();

            // /getting opeartion name
            OMAttribute op_name_att = operation.getAttribute(
                    new QName(ATTNAME));
            if(op_name_att == null){
                throw new DeploymentException(Messages.getMessage("Invalide Operations"));
            }
            String opname = op_name_att.getValue();
            OperationDescription op_descrip = new OperationDescription();
            op_descrip.setName(new QName(opname));

            //Opeartion Paramters
            Iterator paramters = operation.getChildrenWithName(
                    new QName(PARAMETERST));
            processParameters(paramters,op_descrip,module);


            //setting the mep of the operation
            OMAttribute op_mep_att = operation.getAttribute(
                    new QName(MEP));
            if(op_mep_att !=null){
                String mep = op_mep_att.getValue();
                op_descrip.setMessageExchangePattern(mep);
            }

            // loading the message recivers
            OMElement receiverElement = operation.getFirstChildWithName(
View Full Code Here

    private void compareAttibutes(OMElement elementOne, OMElement elementTwo) throws XMLComparisonException {
        int elementOneAtribCount = 0;
        int elementTwoAtribCount = 0;
        Iterator attributes = elementOne.getAttributes();
        while (attributes.hasNext()) {
            OMAttribute omAttribute = (OMAttribute) attributes.next();
            OMAttribute attr = elementTwo.getFirstAttribute(
                    omAttribute.getQName());
            if (attr == null) {
                throw new XMLComparisonException(
                        "Attributes are not the same in two elements. Attribute " +
                        omAttribute.getLocalName() +
View Full Code Here

        String returnString = null;
        if (parser != null) {
            returnString = parser.getAttributeValue(i);
        } else {
            if (isStartElement() || (currentEvent == ATTRIBUTE)) {
                OMAttribute attrib = getAttribute((OMElement) lastNode, i);
                if (attrib != null) {
                    returnString = attrib.getValue();
                }
            } else {
                throw new IllegalStateException(
                        "attribute type accessed in illegal event!");
            }
View Full Code Here

        String returnString = null;
        if (parser != null) {
            returnString = parser.getAttributePrefix(i);
        } else {
            if (isStartElement() || (currentEvent == ATTRIBUTE)) {
                OMAttribute attrib = getAttribute((OMElement) lastNode, i);
                if (attrib != null) {
                    OMNamespace nameSpace = attrib.getNamespace();
                    if (nameSpace != null) {
                        returnString = nameSpace.getPrefix();
                    }
                }
            } else {
View Full Code Here

        String returnString = null;
        if (parser != null) {
            returnString = parser.getAttributeLocalName(i);
        } else {
            if (isStartElement() || (currentEvent == ATTRIBUTE)) {
                OMAttribute attrib = getAttribute((OMElement) lastNode, i);
                if (attrib != null) {
                    returnString = attrib.getLocalName();
                }
            } else {
                throw new IllegalStateException(
                        "attribute localName accessed in illegal event!");
            }
View Full Code Here

        String returnString = null;
        if (parser != null) {
            returnString = parser.getAttributeNamespace(i);
        } else {
            if (isStartElement() || (currentEvent == ATTRIBUTE)) {
                OMAttribute attrib = getAttribute((OMElement) lastNode, i);
                if (attrib != null) {
                    OMNamespace nameSpace = attrib.getNamespace();
                    if (nameSpace != null) {
                        returnString = nameSpace.getName();
                    }
                }
            } else {
View Full Code Here

        if (parser != null) {
            returnString = parser.getAttributeValue(s, s1);
        } else {
            if (isStartElement() || (currentEvent == ATTRIBUTE)) {
                QName qname = new QName(s, s1);
                OMAttribute attrib = ((OMElement)lastNode).getAttribute(qname);
                if (attrib != null) {
                    returnString = attrib.getValue();
                }
            } else {
                throw new IllegalStateException(
                        "attribute type accessed in illegal event!");
            }
View Full Code Here

     * @param elt
     * @param index
     * @return
     */
    private OMAttribute getAttribute(OMElement elt, int index) {
        OMAttribute returnAttrib = null;
        if (elt != null) {
            returnAttrib =
                    (OMAttribute) getItemFromIterator(elt.getAttributes(),
                            index);
        }
View Full Code Here

            } else if (AddressingConstants.WSA_ACTION.equals(soapHeaderBlock.getLocalName())) {
                messageInformationHeaders.setAction(soapHeaderBlock.getText());
                soapHeaderBlock.setProcessed();
            } else if (AddressingConstants.WSA_RELATES_TO.equals(soapHeaderBlock.getLocalName())) {
                String address = soapHeaderBlock.getText();
                OMAttribute relationshipType =
                        soapHeaderBlock.getFirstAttribute(
                                new QName(AddressingConstants.WSA_RELATES_TO_RELATIONSHIP_TYPE));
                String relationshipTypeDefaultValue =
                        Submission.WSA_NAMESPACE.equals(addressingNamespace)
                                ? Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE
                                : Final.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE;
                RelatesTo relatesTo =
                        new RelatesTo(
                                address,
                                relationshipType == null
                                        ? relationshipTypeDefaultValue
                                        : relationshipType.getValue());
                messageInformationHeaders.setRelatesTo(relatesTo);
                soapHeaderBlock.setProcessed();

            }
        }
View Full Code Here

TOP

Related Classes of org.apache.axis2.om.OMAttribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.