Package com.amihaiemil.eoyaml
Class StrictYamlSequence
- java.lang.Object
-
- com.amihaiemil.eoyaml.BaseYamlSequence
-
- com.amihaiemil.eoyaml.StrictYamlSequence
-
- All Implemented Interfaces:
YamlNode,YamlSequence,Comparable<YamlNode>,Iterable<YamlNode>
@Deprecated public final class StrictYamlSequence extends BaseYamlSequence
Deprecated.This class will be moved to the extensions package in one of the future releases. There will be no changes to it other than a more suitable package.Decorator for aYamlSequencewhich throws YamlNodeNotFoundException if any of the methods of the decorated YamlSequence returns null (if the given index points to a YamlNode that is not a YamlMapping, for instance).- Since:
- 1.0.0
- Version:
- $Id: c32b6632b2c99a3df79ee916cb880567a288494c $
- Author:
- Salavat.Yalalov (s.yalalov@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description StrictYamlSequence(YamlSequence decorated)Deprecated.Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T extends YamlNode>
TasClass(Class<T> clazz, Node type)Gives theYamlNodeinstance from node class and node type.YamlMappingasMapping()Gives a Mapping value of the node.ScalarasScalar()Gives a String value of the node.YamlSequenceasSequence()Gives a Sequence value of the node.YamlStreamasStream()Gives a Stream value of the node.Commentcomment()Deprecated.Comment referring to this Node.StringfoldedBlockScalar(int index)Deprecated.Get the folded block String from the given index.Collection<String>literalBlockScalar(int index)Deprecated.Get the literal block Strings from the given index.Stringstring(int index)Deprecated.Get the String from the given index.StringtoString()Print this YamlNode using a StringWriter to create its String representation.Collection<YamlNode>values()Deprecated.Fetch the values of this sequence.YamlMappingyamlMapping(int index)Deprecated.Get the Yaml mapping from the given index.YamlSequenceyamlSequence(int index)Deprecated.Get the Yaml sequence from the given index.-
Methods inherited from class com.amihaiemil.eoyaml.BaseYamlSequence
compareTo, equals, hashCode, isEmpty, type
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface com.amihaiemil.eoyaml.YamlNode
asClass, asMapping, asScalar, asSequence, asStream
-
Methods inherited from interface com.amihaiemil.eoyaml.YamlSequence
date, dateTime, doubleNumber, floatNumber, integer, iterator, longNumber, size
-
-
-
-
Constructor Detail
-
StrictYamlSequence
public StrictYamlSequence(YamlSequence decorated)
Deprecated.Ctor.- Parameters:
decorated- Original YamlSequence
-
-
Method Detail
-
values
public Collection<YamlNode> values()
Deprecated.Description copied from interface:YamlSequenceFetch the values of this sequence.- Returns:
- Collection of
YamlNode
-
yamlMapping
public YamlMapping yamlMapping(int index)
Deprecated.Get the Yaml mapping from the given index.- Parameters:
index- Integer index.- Returns:
- Yaml mapping
-
yamlSequence
public YamlSequence yamlSequence(int index)
Deprecated.Get the Yaml sequence from the given index.- Parameters:
index- Integer index.- Returns:
- Yaml sequence
-
string
public String string(int index)
Deprecated.Get the String from the given index.- Parameters:
index- Integer index.- Returns:
- String
-
foldedBlockScalar
public String foldedBlockScalar(int index)
Deprecated.Get the folded block String from the given index.- Parameters:
index- Integer index.- Returns:
- String
-
literalBlockScalar
public Collection<String> literalBlockScalar(int index)
Deprecated.Get the literal block Strings from the given index.- Parameters:
index- Integer index.- Returns:
- Collection of String lines of the literal.
-
comment
public Comment comment()
Deprecated.Description copied from interface:YamlNodeComment referring to this Node.- Returns:
- Comment. If there is no comment, it will return an "empty" comment (an instance of Comment with empty-string value()).
-
asScalar
public final Scalar asScalar() throws YamlReadingException, ClassCastException
Description copied from interface:YamlNodeGives a String value of the node.- Specified by:
asScalarin interfaceYamlNode- Returns:
- String value of the node.
- Throws:
YamlReadingException- If the node type is not Scalar.ClassCastException- If the node type couldn't defined correctly.
-
asMapping
public final YamlMapping asMapping() throws YamlReadingException, ClassCastException
Description copied from interface:YamlNodeGives a Mapping value of the node.- Specified by:
asMappingin interfaceYamlNode- Returns:
- Mapping value of the node.
- Throws:
YamlReadingException- If the node type is not Mapping.ClassCastException- If the node type couldn't defined correctly.
-
asSequence
public final YamlSequence asSequence() throws YamlReadingException, ClassCastException
Description copied from interface:YamlNodeGives a Sequence value of the node.- Specified by:
asSequencein interfaceYamlNode- Returns:
- Sequence value of the node.
- Throws:
YamlReadingException- If the node type is not Sequence.ClassCastException- If the node type couldn't defined correctly.
-
asStream
public final YamlStream asStream() throws YamlReadingException, ClassCastException
Description copied from interface:YamlNodeGives a Stream value of the node.- Specified by:
asStreamin interfaceYamlNode- Returns:
- Stream value of the node.
- Throws:
YamlReadingException- If the node type is not Stream.ClassCastException- If the node type couldn't defined correctly.
-
asClass
public final <T extends YamlNode> T asClass(Class<T> clazz, Node type) throws YamlReadingException, ClassCastException
Description copied from interface:YamlNodeGives theYamlNodeinstance from node class and node type.- Specified by:
asClassin interfaceYamlNode- Type Parameters:
T- Requested aYamlNodeclass instance.- Parameters:
clazz- Requested aYamlNodeclass.type- Requested aNode.- Returns:
- Requested a
YamlNode. - Throws:
YamlReadingException- If the type is not aYamlNode.ClassCastException- If the node type couldn't defined correctly.
-
toString
public final String toString()
Print this YamlNode using a StringWriter to create its String representation.- Overrides:
toStringin classObject- Returns:
- String print of this YamlNode.
- Throws:
YamlPrintException- If there is any I/O problem when printing the YAML.
-
-