@Retention(value=RUNTIME) @Documented @Target(value={FIELD,METHOD}) public @interface Exported
ExportedBean
Modifier and Type | Optional Element and Description |
---|---|
boolean |
inline
Visibility adjustment for traversing this property.
|
boolean |
merge
Include an object referenced by this property as if all its properties
are merged into properties of the current object.
|
String |
name
Name of the exposed property.
|
boolean |
skipNull
If the value is null, don't even write the property.
|
String |
verboseMap
If a string value "key/value" is given, produce a map in more verbose following form:
"[{key:KEY1, value:VALUE1}, {key:KEY2, value:VALUE2}, ...]
(whereas normally it produces more compact {KEY1:VALUE1, KEY2:VALUE2, ...}
|
int |
visibility
Controls how visible this property is.
|
public abstract int visibility
If the value is 1, the property will be visible only when the current model object is exposed as the top-level object.
If the value is 2, in addition to above, the property will still be visible if the current model object is exposed as the 2nd-level object.
And the rest goes in the same way. If the value is N, the object is exposed as the Nth level object.
The default value of this property is determined by
ExportedBean.defaultVisibility()
.
So bigger the number, more important the property is.
public abstract String name
This token is used as the XML element name or the JSON property name. The default is to use the Java property name.
public abstract boolean inline
If true, visiting this property won't increase the depth count, so the referenced object is exported as if it were a part of this object.
This flag can be used to selectively expand the subtree to be returned to the client.
public abstract boolean merge
Any duplicate properties from the referenced object will be masked.
public abstract boolean skipNull
{ foo: null, bar: "abc" }With this switch enabled on the 'foo' field, the above will become this:
{ bar: "abc" }
public abstract String verboseMap
So for example, if you say "name/value", you might see something like "[{name:"kohsuke", value:"abc"], ...}
The verbose form is useful/necessary when you use complex data structure as a key, or if the string representation of the key can contain letters that are unsafe in some flavours (such as XML, which prohibits a number of characters to be used as tag names.)
Copyright © 2004–2022. All rights reserved.