English 中文(简体)
what is yaml file in java and use of it?
原标题:

i saw some site like this http://jyaml.sourceforge.net/ for yaml in java.

but i can t to use of that.

how can i use form yaml files?

if is it possible to use it in javafx 2.0?

thanks.

问题回答

What is YAML
You should see the Wikipedia page for YAML at least. The official YAML website defines it as

[...] a human friendly data serialization standard for all programming languages.


Use with Java
It depends on what you want to use it for - the most common use (I d imagine, since I haven t used it myself) would be for storing application configuration, as an alternative to XML or JSON. Essentially, you ll have a simple text file that contains data in a structured format as defined by the YAML spec. Here is an article that discusses the use of YAML with Java.

To avoid reinventing the wheel, you should make use of a library that performs the serialization and deserialization for you i.e. it can read from and write to the text file and parse the data in it and hand it over to your application in an easier to use object form. The business logic, of course, must be written by you. There are several Java libraries that are available and this question on SO talks about which one to use and why: https://stackoverflow.com/questions/450399/which-java-yaml-library-should-i-use.

Yaml is a file format*, and jYaml is a Java library for working with that file format.

So you may use it to read or write information into this format.

How can i use form yaml files?

You write one, and use it with this library.

If is it possible to use it in javafx 2.0?

Can you use this library in JavaFX 2.0? If you can then yes. :)

* See comment





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签