Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMException


                } else {
                    next()// continue looking past whitespace etc.
                }
            }
        } catch (XMLStreamException e) {
            throw new OMException(e);
        }
    }
View Full Code Here


    }
   
    String getRootPartContentType() {
        String rootPartContentID = getRootPartContentID();
        if (rootPartContentID == null) {
            throw new OMException("Unable to determine the content ID of the root part");
        }
        DataHandler rootPart = getDataHandler(rootPartContentID);
        if (rootPart == null) {
            throw new OMException("Unable to locate the root part; content ID was " + rootPartContentID);
        }
        return rootPart.getContentType();
    }
View Full Code Here

        }
    }

    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
        if (data == null) {
            throw new OMException("The InputStreamDataSource does not have a backing object");
        }
        super.serialize(xmlWriter);
    }
View Full Code Here

        super.serialize(xmlWriter);
    }
   
    public XMLStreamReader getReader() throws XMLStreamException {
        if (data == null) {
            throw new OMException("The InputStreamDataSource does not have a backing object");
        }
        return StAXUtils.createXMLStreamReader(data.is,data.encoding);                                                                      
    }
View Full Code Here

                DataHandler dataHandler = nextPart.getDataHandler();
                addDataHandler(id, dataHandler);
                return dataHandler;
            }
            if (partContentID == null) {
                throw new OMException(
                        "Part content ID cannot be blank for non root MIME parts");
            }
            if ((partContentID.indexOf("<") > -1)
                    & (partContentID.indexOf(">") > -1)) {
                partContentID = partContentID.substring(1, (partContentID
                        .length() - 1));

            }
            if (partIndex == 1) {
                firstPartId = partContentID;
            }
            if (attachmentsMap.containsKey(partContentID)) {
                throw new OMException(
                        "Two MIME parts with the same Content-ID not allowed.");
            }
            DataHandler dataHandler = nextPart.getDataHandler();
            addDataHandler(partContentID, dataHandler);
            return dataHandler;
View Full Code Here

    }
   
    public InputStream getXMLInputStream(String encodingthrows
        UnsupportedEncodingException{
        if (data == null) {
            throw new OMException("The InputStreamDataSource does not have a backing object");
        }
        return data.is;
    }
View Full Code Here

           
            partIndex++;
            currentPart = new PartImpl(this, isRootPart, headers, parser);
            return currentPart;
        } catch (IOException ex) {
            throw new OMException(ex);
        } catch (MimeException ex) {
            throw new OMException(ex);
        }
    }
View Full Code Here

       return data;
    }

    public boolean isDestructiveRead() {
        if (data == null) {
            throw new OMException("The InputStreamDataSource does not have a backing object");
        }
        return true;
    }
View Full Code Here

        return true;
    }

    public boolean isDestructiveWrite() {
        if (data == null) {
            throw new OMException("The InputStreamDataSource does not have a backing object");
        }
        // Writing an input stream is destructive
        return true;
    }
View Full Code Here

        OMOutputFormat format = new OMOutputFormat();
        format.setCharSetEncoding(encoding);
        try {
            serialize(baos, format);
        } catch (XMLStreamException e) {
            throw new OMException(e);
        }
        return baos.toByteArray();
    }
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.