[jboss-dev-forums] [JBoss AS 7 Development] - CLICompoundValueFormat
Alexey Loubyansky
do-not-reply at jboss.com
Wed Apr 11 09:05:39 EDT 2012
Alexey Loubyansky [https://community.jboss.org/people/aloubyansky] created the document:
"CLICompoundValueFormat"
To view the document, visit: https://community.jboss.org/docs/DOC-17944
--------------------------------------------------------------
h2. Compound Operation Parameter (or Command Argument) Value Format
Operation parameters of simple types (such as integer, boolean, string, etc) are easily expressed with a string (i.e. a word) value. Others (such as lists, properties, objects, etc) require a special syntax.
These compound values can expressed in two formats. The first and the original one is the native DMR (Dynamic Model Representation) format. All the CLI operations and commands are translated into the DMR requests using +org.jboss.dmr.ModelNode+ API. +org.jboss.dmr.ModelNode+ has +toString()+ and +fromString(str)+ methods that output and read string representations of the DMR nodes in its specific format.
You can see examples of values in this format in https://community.jboss.org/docs/DOC-16336 the Format of a Detyped Operation Request and https://community.jboss.org/docs/DOC-16354 the Format of a Detyped Operation Response articles or simply construct your own instances of +org.jboss.dmr.ModelNode+ and call +toString()+ on them.
As you, probably, know, the DMR format is very verbose and not easy to type complex values in w/o making mistakes. This is why the CLI supports a simplified version of the format. Basically, it doesn't require quotes around the values and accepts '=' instead of '=>'.
Here are a few examples (the examples show only the operation of command parameters w/o the rest of the operations, i.e. the address part and operation name.
Simple string value:
+param_name=value+
A list (the two versions are equivalent):
+param_name=a,b,c+
+param_name=[a,b,c]+
Nested lists:
+param_name=[a,b,[c,d]]+
A list of properties:
+param_name=[a=b,c=d]+
Values of type OBJECT (the two versions are equivalent):
+param_name=a=b,c=d+
+param_name={a=b,c=d}+
Object with a property of type list:
+param_name=a=b,c=[d,e]+
Object with a child of type object:
+param_name=a=b,c={d=e}+
Object with a complex property list:
+param_list=a=b,c=[d=e,f={g=h}]+
These are, of course, simple but, hopefully, sufficient examples to give an idea of the compound value format.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-17944]
Create a new document in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120411/89ad9564/attachment.html
More information about the jboss-dev-forums
mailing list