Package org.yaml.snakeyaml.error

Examples of org.yaml.snakeyaml.error.YAMLException


                    case sequence:
                        return yamlConstructors.get(Tag.SEQ).construct(node);
                    case mapping:
                        return yamlConstructors.get(Tag.MAP).construct(node);
                    default:
                        throw new YAMLException("Unexpected node");
                    }
                }
            }
View Full Code Here


        private class ConstructSetFromSequence extends ConstructSequence {
            @Override
            public Object construct(Node node) {
                if (SortedSet.class.isAssignableFrom(node.getType())) {
                    if (node.isTwoStepsConstruction()) {
                        throw new YAMLException("Set cannot be recursive.");
                    } else {
                        Collection<Object> result = new TreeSet<Object>();
                        SetContructor.this.constructSequenceStep2((SequenceNode) node, result);
                        return result;
                    }
View Full Code Here

                    return node;
                }
            }
            // check array of primitives
            if (clazz.isArray()) {
                throw new YAMLException("Arrays of primitives are not fully supported.");
            }
            // check defaults
            if (multiRepresenters.containsKey(null)) {
                Represent representer = multiRepresenters.get(null);
                node = representer.representData(data);
View Full Code Here

                tag = Tag.BINARY;
                char[] binary;
                try {
                    binary = Base64Coder.encode(value.getBytes("UTF-8"));
                } catch (UnsupportedEncodingException e) {
                    throw new YAMLException(e);
                }
                value = String.valueOf(binary);
                style = '|';
            }
            // if no other scalar style is explicitly set, use literal style for
View Full Code Here

                    key.hashCode();// check circular dependencies
                }
                Object value = constructObject(valueNode);
                Object old = mapping.put(key, value);
                if (old != null) {
                    throw new YAMLException("The key is not unique " + key);
                }
            }
        }
View Full Code Here

            }
            Composer composer = new Composer(new CanonicalParser(buffer.toString()), resolver);
            constructor.setComposer(composer);
            return constructor.getSingleData(Object.class);
        } catch (IOException e) {
            throw new YAMLException(e);
        }
    }
View Full Code Here

                    throw new UnsupportedOperationException();
                }
            };
            return new YamlIterable(result);
        } catch (IOException e) {
            throw new YAMLException(e);
        }
    }
View Full Code Here

                Version version = null;
                // TODO ???
                if (versionList != null) {
                    Integer major = versionList.get(0).intValue();
                    if (major != 1) {
                        throw new YAMLException("Unsupported version.");
                    }
                    Integer minor = versionList.get(1).intValue();
                    if (minor == 0) {
                        version = Version.V1_0;
                    } else {
View Full Code Here

    @Override
    public boolean onMappingNodeStart(MappingNode mappingNode, TupleType tupleType)
    {
        if (tupleType == KEY)
        {
            throw new YAMLException(NON_SCALAR_KEY_MESSAGE + ": " + mappingNode.getStartMark());
        }
        NodeBuilder<?> currentBuilder = builderContext.peek();
        Object parentObject = documentContext.peek();
        Object object = ((TupleBuilder<?, MappingNode>) currentBuilder).buildValue(parentObject, mappingNode);
        documentContext.push(object);
View Full Code Here

    @Override
    public void onMappingNodeEnd(MappingNode mappingNode, TupleType tupleType)
    {
        if (tupleType == KEY)
        {
            throw new YAMLException(NON_SCALAR_KEY_MESSAGE + ": " + mappingNode.getStartMark());
        }
        documentContext.pop();
    }
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.