Class ResourceModel
- java.lang.Object
-
- org.glassfish.jersey.server.model.ResourceModel
-
- All Implemented Interfaces:
ResourceModelComponent
public class ResourceModel extends java.lang.Object implements ResourceModelComponent
Resource model of the deployed application which contains set of root resources. As it implementsResourceModelComponentit can be validated bycomponent model validatorwhich will perform validation of the entire resource model including all sub components (resources,resource methods...).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResourceModel.BuilderBuilder used to createresource modelinstances.
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Resource>resourcesprivate java.util.List<Resource>rootResourcesprivate Value<RuntimeResourceModel>runtimeRootResourceModelValue
-
Constructor Summary
Constructors Modifier Constructor Description privateResourceModel(java.util.List<Resource> rootResources, java.util.List<Resource> allResources)Creates new instance from root allResources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ResourceModelVisitor visitor)A component should call the visitor back with an appropriate visitor interface method to give it a chance to process.java.util.List<? extends ResourceModelComponent>getComponents()Should return all existing resource model sub-components.java.util.List<Resource>getResources()Return all resources from this resource model.java.util.List<Resource>getRootResources()Return root resources from this resource model.RuntimeResourceModelgetRuntimeResourceModel()Returnruntime resource modelbased on this this resource model.
-
-
-
Field Detail
-
rootResources
private final java.util.List<Resource> rootResources
-
resources
private final java.util.List<Resource> resources
-
runtimeRootResourceModelValue
private final Value<RuntimeResourceModel> runtimeRootResourceModelValue
-
-
Method Detail
-
getRootResources
public java.util.List<Resource> getRootResources()
Return root resources from this resource model.- Returns:
- List of root resources.
-
getResources
public java.util.List<Resource> getResources()
Return all resources from this resource model.- Returns:
- List of all resources (root and non root resources).
-
accept
public void accept(ResourceModelVisitor visitor)
Description copied from interface:ResourceModelComponentA component should call the visitor back with an appropriate visitor interface method to give it a chance to process.- Specified by:
acceptin interfaceResourceModelComponent- Parameters:
visitor- resource model visitor.
-
getComponents
public java.util.List<? extends ResourceModelComponent> getComponents()
Description copied from interface:ResourceModelComponentShould return all existing resource model sub-components.- Specified by:
getComponentsin interfaceResourceModelComponent- Returns:
- list of all sub-components
-
getRuntimeResourceModel
public RuntimeResourceModel getRuntimeResourceModel()
Returnruntime resource modelbased on this this resource model.- Returns:
- Runtime resource model created from this resource model.
-
-