public AxiomElementType handleEvent()

in mixins/om-mixins/src/main/java/org/apache/axiom/soap/impl/common/builder/SOAP11BuilderHelper.java [35:82]


    public AxiomElementType<? extends AxiomElement> handleEvent(
            OMElement parent, int elementLevel, String namespaceURI, String localName)
            throws SOAPProcessingException {
        AxiomElementType<? extends AxiomElement> elementType = null;

        if (elementLevel == 4) {

            if (SOAP_FAULT_CODE_LOCAL_NAME.equals(localName)) {

                elementType = AxiomNodeFactory::createSOAP11FaultCode;
                faultcodePresent = true;
            } else if (SOAP_FAULT_STRING_LOCAL_NAME.equals(localName)) {

                elementType = AxiomNodeFactory::createSOAP11FaultReason;
                faultstringPresent = true;
            } else if (SOAP_FAULT_ACTOR_LOCAL_NAME.equals(localName)) {
                elementType = AxiomNodeFactory::createSOAP11FaultRole;
            } else if (SOAP_FAULT_DETAIL_LOCAL_NAME.equals(localName)) {
                elementType = AxiomNodeFactory::createSOAP11FaultDetail;
            } else {
                elementType = AxiomNodeFactory::createNSAwareElement;
            }

        } else if (elementLevel == 5) {

            String parentTagName = "";
            if (parent instanceof Element) {
                parentTagName = ((Element) parent).getTagName();
            } else {
                parentTagName = parent.getLocalName();
            }

            if (parentTagName.equals(SOAP_FAULT_CODE_LOCAL_NAME)) {
                throw new SOAPProcessingException("faultcode element should not have children");
            } else if (parentTagName.equals(SOAP_FAULT_STRING_LOCAL_NAME)) {
                throw new SOAPProcessingException("faultstring element should not have children");
            } else if (parentTagName.equals(SOAP_FAULT_ACTOR_LOCAL_NAME)) {
                throw new SOAPProcessingException("faultactor element should not have children");
            } else {
                elementType = AxiomNodeFactory::createNSAwareElement;
            }

        } else if (elementLevel > 5) {
            elementType = AxiomNodeFactory::createNSAwareElement;
        }

        return elementType;
    }