Sunday, July 22, 2018

YAML




YAML (YAML Ain't Markup Language) is a human-readable data serialization language. It is commonly used for configuration files, but could be used in many applications where data is being stored (e.g. debugging output) or transmitted (e.g. document headers). YAML targets many of the same communications applications as XML but has a minimal syntax which intentionally breaks compatibility with SGML[1]. It uses both Python-style indentation to indicate nesting, and a more compact format that uses [] for lists and {} for maps[1] making YAML 1.2 a superset of JSON.[2]
Custom data types are allowed, but YAML natively encodes scalars (such as stringsintegers, and floats), lists, and associative arrays (also known as hashes, maps, or dictionaries). These data types are based on the Perl programming language, though all commonly used high-level programming languages share very similar concepts. The colon-centered syntax, used to express key-value pairs, is inspired by electronic mail headers as defined in RFC 0822, and the document separator "---" is borrowed from MIME (RFC 2045)[not in citation given]Escape sequences are reused from C, and whitespace wrapping for multi-line strings is inspired from HTML. Lists and hashes can contain nested lists and hashes, forming a tree structure; arbitrary graphs can be represented using YAML aliases (similar to XML in SOAP).[1] YAML is intended to be read and written in streams, a feature inspired by SAX.[1]
Support for reading and writing YAML is available for many programming languages.[3] Some source code editors such as Emacs[4] and various integrated development environments[5][6][7] have features that make editing YAML easier, such as folding up nested structures or automatically highlighting syntax errors.


https://codebeautify.org/


Custom Content Handler 


It is used to handle any kind of formate.  JAXRS  has provided 2 interfaces.

1.  MessageBodyReader -- 1.  readFrom(InputStream is)
                        2.  isReadable()

2  Message BodyWriter -  1. isWritable() 
                                                   2. getSize()
                                                   3. writeTo(OutPutStream os )


Note :  Before resource will execute MessageBodyReader  will be called.  It will read the input data by  InputStream.

          After  resource will execute MessageBodyWriter will be called.  It will write the output dat ainto Outputstream.

  • No braces require for yaml document.
  • Message body reader  and Message body writer.

No comments:

Post a Comment

Hyderabad Trip - Best Places to visit

 Best Places to Visit  in Hyderabad 1.        1. Golconda Fort Maps Link :   https://www.google.com/maps/dir/Aparna+Serene+Park,+Masj...