Package org.yaml.snakeyaml.error

Examples of org.yaml.snakeyaml.error.YAMLException


    private final Mark startMark;
    private final Mark endMark;

    public Token(Mark startMark, Mark endMark) {
        if (startMark == null || endMark == null) {
            throw new YAMLException("Token requires marks.");
        }
        this.startMark = startMark;
        this.endMark = endMark;
    }
View Full Code Here


    public DirectiveToken(String name, List<T> value, Mark startMark, Mark endMark) {
        super(startMark, endMark);
        this.name = name;
        if (value != null && value.size() != 2) {
            throw new YAMLException("Two strings must be provided instead of "
                    + String.valueOf(value.size()));
        }
        this.value = value;
    }
View Full Code Here

            Object obj = createInstance(node, data);
            Map<String, Object> properties = new HashMap<String, Object>(data.getProperties());
            setProperties(obj, properties);
            return obj;
        } catch (Exception e) {
            throw new YAMLException(e);
        }
    }
View Full Code Here

            String key = entry.getKey();
            Property property = getPropertyUtils().getProperty(bean.getClass(), key);
            try {
                property.set(bean, entry.getValue());
            } catch (IllegalArgumentException e) {
                throw new YAMLException("Cannot set property='" + key + "' with value='"
                        + data.get(key) + "' (" + data.get(key).getClass() + ") in " + bean);
            }
        }
    }
View Full Code Here

        try {
            Property property = getPropertyUtils().getProperty(bean.getClass(),
                    getSequencePropertyName(bean.getClass()));
            property.set(bean, value);
        } catch (Exception e) {
            throw new YAMLException(e);
        }
    }
View Full Code Here

            if (!List.class.isAssignableFrom(property.getType())) {
                iterator.remove();
            }
        }
        if (properties.size() == 0) {
            throw new YAMLException("No list property found in " + bean);
        } else if (properties.size() > 1) {
            throw new YAMLException(
                    "Many list properties found in "
                            + bean
                            + "; Please override getSequencePropertyName() to specify which property to use.");
        }
        return properties.iterator().next().getName();
View Full Code Here

            return toDom( constructMapping( (MappingNode) node ) );
        }

        public void construct2ndStep( Node node, Object object )
        {
            throw new YAMLException( "Unexpected recursive mapping structure. Node: " + node );
        }
View Full Code Here

                continue;
            properties.add( new FieldProperty( field ) );
        }
        if ( properties.isEmpty() )
        {
            throw new YAMLException( "No JavaBean properties found in " + type.getName() );
        }
        return properties;
    }
View Full Code Here

            {
                properties = getProperties( data.getClass() );
            }
            catch ( IntrospectionException e )
            {
                throw new YAMLException( e );
            }
            Node node = representJavaBean( properties, data );
            return node;
        }
View Full Code Here

TOP

Related Classes of org.yaml.snakeyaml.error.YAMLException

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.