Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMException


            return getTextFromProperPlace();
        } else {
            try {
                return Base64Utils.encode((DataHandler)getDataHandler());
            } catch (Exception e) {
                throw new OMException(e);
            }
        }
    }
View Full Code Here


            return value.toCharArray();
        } else {
            try {
                return Base64Utils.encodeToCharArray((DataHandler)getDataHandler());
            } catch (IOException ex) {
                throw new OMException(ex);
            }
        }
    }
View Full Code Here

            return org.apache.axiom.attachments.utils.DataHandlerUtils
                    .getDataHandlerFromText(text, mimeType);
        } else {

            if (dataHandlerObject == null) {
                throw new OMException("No DataHandler available");
            } else if (dataHandlerObject instanceof DataHandlerProvider) {
                try {
                    dataHandlerObject = ((DataHandlerProvider)dataHandlerObject).getDataHandler();
                } catch (IOException ex) {
                    throw new OMException(ex);
                }
            }
            return dataHandlerObject;
        }
    }
View Full Code Here

                } else {
                    XMLStreamWriterUtils.writeDataHandler(writer, (DataHandler)getDataHandler(),
                            contentID, optimize);
                }
            } catch (IOException ex) {
                throw new OMException("Error reading data handler", ex);
            }
        }
    }
View Full Code Here

        } else {
            // UNQUALIFIED NAMESPACE
           
            // Neither XML 1.0 nor XML 1.1 allow to associate a prefix with an unqualified name (see also AXIOM-372).
            if (prefix.length() > 0) {
                throw new OMException("Invalid namespace declaration: Prefixed namespace bindings may not be empty.")
            }
           
            // Get the namespace associated with the prefix.
            // It is illegal to call getPrefix with null, but the specification is not
            // clear on what happens if called with "".  So the following code is
View Full Code Here

    public static String getContentID(XMLStreamReader parser) {
        if (parser.getAttributeCount() > 0 &&
                parser.getAttributeLocalName(0).equals("href")) {
            return getContentIDFromHref(parser.getAttributeValue(0));
        } else {
            throw new OMException(
                    "Href attribute not found in XOP:Include element");
        }
    }
View Full Code Here

        addChild(child, false);
    }

    public void addChild(OMNode omNode, boolean fromBuilder) {
        if (!fromBuilder && omNode instanceof OMElement && getOMDocumentElement() != null) {
            throw new OMException("Document element already exists");
        }
        OMContainerHelper.addChild(this, omNode, fromBuilder);
    }
View Full Code Here

        }

        mpw.complete();
      }
      catch (IOException ex) {
        throw new OMException("Error writing SwA message", ex);
      }
    }
View Full Code Here

        }
    }

    /** Method createDTD. Overriding the default behaviour as a SOAPMessage should not have a DTD. */
    protected OMNode createDTD() throws OMException {
        throw new OMException("SOAP message MUST NOT contain a Document Type Declaration(DTD)");
    }
View Full Code Here

        throw new OMException("SOAP message MUST NOT contain a Document Type Declaration(DTD)");
    }

    /** Method createPI. Overriding the default behaviour as a SOAP Message should not have a PI. */
    protected OMNode createPI() throws OMException {
        throw new OMException("SOAP message MUST NOT contain Processing Instructions(PI)");
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.OMException

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.