Package org.jboss.hal.meta
Class Metadata
- java.lang.Object
-
- org.jboss.hal.meta.Metadata
-
public class Metadata extends Object
Simple data struct for common metadata. Used to keep the method signatures small and tidy.
-
-
Constructor Summary
Constructors Constructor Description Metadata(AddressTemplate template, Supplier<SecurityContext> securityContext, ResourceDescription description, Capabilities capabilities)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyAttribute(String attribute, Metadata destination)Copies attributes from this description to the specified metadatavoidcopyComplexAttributeAttributes(Iterable<String> attributes, Metadata destination)Shortcut forcopyAttribute(String, Metadata)andmakeWritable(String)static Metadataempty()MetadataforComplexAttribute(String name)Creates a new metadata instance based on this metadata with the attributes taken from the specified complex attribute.MetadataforComplexAttribute(String name, boolean prefixLabel)Creates a new metadata instance based on this metadata with the attributes taken from the specified complex attribute.MetadataforOperation(String name)CapabilitiesgetCapabilities()ResourceDescriptiongetDescription()SecurityContextgetSecurityContext()AddressTemplategetTemplate()voidmakeWritable(String attribute)Makes the specified attribute writable.static MetadatastaticDescription(com.google.gwt.resources.client.TextResource description)static MetadatastaticDescription(ResourceDescription description)Constructs a Metadata with read-write-execution permissions and a non-working Capabilities object.static MetadatastaticDescription(ResourceDescription description, Environment environment)Constructs a Metadata with read-write-execution permissions and a working Capabilities object based on the environment object.
-
-
-
Constructor Detail
-
Metadata
public Metadata(AddressTemplate template, Supplier<SecurityContext> securityContext, ResourceDescription description, Capabilities capabilities)
-
-
Method Detail
-
empty
public static Metadata empty()
-
staticDescription
public static Metadata staticDescription(com.google.gwt.resources.client.TextResource description)
-
staticDescription
public static Metadata staticDescription(ResourceDescription description)
Constructs a Metadata with read-write-execution permissions and a non-working Capabilities object.
-
staticDescription
public static Metadata staticDescription(ResourceDescription description, Environment environment)
Constructs a Metadata with read-write-execution permissions and a working Capabilities object based on the environment object.
-
copyAttribute
public void copyAttribute(String attribute, Metadata destination)
Copies attributes from this description to the specified metadata
-
makeWritable
public void makeWritable(String attribute)
Makes the specified attribute writable. This is necessary if you copy attributes from a complex attribute to another metadata. Without adjustment the copied attributes are read-only in the destination metadata.
-
copyComplexAttributeAttributes
public void copyComplexAttributeAttributes(Iterable<String> attributes, Metadata destination)
Shortcut forcopyAttribute(String, Metadata)andmakeWritable(String)
-
forComplexAttribute
public Metadata forComplexAttribute(String name)
Creates a new metadata instance based on this metadata with the attributes taken from the specified complex attribute. The resource description will only include the attributes but no operations!
-
forComplexAttribute
public Metadata forComplexAttribute(String name, boolean prefixLabel)
Creates a new metadata instance based on this metadata with the attributes taken from the specified complex attribute. The resource description will only include the attributes but no operations!- Parameters:
prefixLabel- iftruethe labels of the attributes of the complex attribute are prefixed with name of the complex attribute.
-
getTemplate
public AddressTemplate getTemplate()
- Returns:
- the address template
-
getSecurityContext
public SecurityContext getSecurityContext()
- Returns:
- the security context
-
getDescription
public ResourceDescription getDescription()
- Returns:
- the resource description
-
getCapabilities
public Capabilities getCapabilities()
-
-