Package org.apache.wink.common

Examples of org.apache.wink.common.RestException


    public static Unmarshaller createUnmarshaller() {
        try {
            Unmarshaller unmarshaller = context.createUnmarshaller();
            return unmarshaller;
        } catch (JAXBException e) {
            throw new RestException(Messages.getMessage("webDAVFailCreateUnmarshaller"), e); //$NON-NLS-1$
        }
    }
View Full Code Here


    public static void marshal(Marshaller m, Object element, Writer writer, String elementName) {
        try {
            m.marshal(element, writer);
        } catch (JAXBException e) {
            throw new RestException(Messages
                .getMessage("webDAVUnableToMarshalElement", elementName), e); //$NON-NLS-1$
        }
    }
View Full Code Here

            Object object = u.unmarshal(reader);
            if (object instanceof JAXBElement) {
                object = ((JAXBElement<?>)object).getValue();
            }
            if (!(elementClass.equals(object.getClass()))) {
                throw new RestException(Messages
                    .getMessage("webDAVIncompatibleTypeInRequest", elementName, object.getClass() //$NON-NLS-1$
                        .getName(), elementClass.getName()));
            }
            return (T)object;
        } catch (JAXBException e) {
            throw new RestException(Messages.getMessage("webDAVUnableToParseElement", elementName), //$NON-NLS-1$
                                    e);
        }
    }
View Full Code Here

     */
    public static AppService unmarshal(Reader reader) {
        try {
            return (AppService)ModelUtils.unmarshal(AppService.getUnmarshaller(), reader);
        } catch (IOException e) {
            throw new RestException(e);
        }
    }
View Full Code Here

    public boolean hasNext() {
        if (!moved) {
            try {
                lastMoveResult = MPParser.nextPart();
            } catch (IOException e) {
                throw new RestException(e);
            }
            moved = true;
            index++;
        }
        return lastMoveResult;
View Full Code Here

     */
    public static AppCategories unmarshal(Reader reader) {
        try {
            return (AppCategories)ModelUtils.unmarshal(AppCategories.getUnmarshaller(), reader);
        } catch (IOException e) {
            throw new RestException(e);
        }
    }
View Full Code Here

     * Objects of the following type(s) are allowed in the list
     * {@link AtomCategory }
     */
    public List<AtomCategory> getCategory() {
        if (!isInline()) {
            throw new RestException(ERROR_MESSAGE);
        }
        return getCategoryNoCheck();
    }
View Full Code Here

        return getHref() == null;
    }

    public void checkValidity() {
        if ((getScheme() != null || getCategoryNoCheck().size() > 0 || isFixedSet()) && getHref() != null) {
            throw new RestException(ERROR_MESSAGE);
        }
    }
View Full Code Here

     */
    public Date getValueAsDate() {
        try {
            return WebDAVModelHelper.convertXMLDateToDate(getValue());
        } catch (ParseException e) {
            throw new RestException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.wink.common.RestException

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.