Package org.simpleframework.xml

Examples of org.simpleframework.xml.Root


        checkNotNull(beanDesc);
        return (T) beanDesc.getBean();
    }

    private <T> BeanDesc<T> loadBeanDesc(Class<T> clazz, boolean isRemoteFirst) {
        Root root = clazz.getAnnotation(Root.class);
        checkNotNull(root, "class %s must have annotation %s", clazz.getName(), Root.class.getName());
        String fileName = root.name();

        List<Loader> loaders = isRemoteFirst ?
                Lists.newArrayList(remoteLoader, localLoader) :
                Lists.newArrayList(localLoader, remoteLoader);
View Full Code Here


    /**
     * Returns an object deserialized from a child node of a given memento.
     */
    public static <T> T getChild(Class<T> clazz, IMemento memento) throws IOException
    {
        Root root = clazz.getAnnotation(Root.class);

        if (root == null)
        {
            throw new IllegalArgumentException("Missing @Root annotation on: "
                + clazz.getName());
        }

        String childName = root.name();
        if (StringUtils.isEmpty(childName))
        {
            childName = getClassName(clazz);
        }

View Full Code Here

    /**
     * Check if the target contains simple XML's annotation.
     */
    private static void checkObject(Object object)
    {
        Root root = object.getClass().getAnnotation(Root.class);
        if (root == null)
        {
            throw new IllegalArgumentException("Missing @Root annotation on: "
                + object.getClass());
        }
View Full Code Here

TOP

Related Classes of org.simpleframework.xml.Root

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.