Class ResourceModel.Builder
java.lang.Object
org.glassfish.jersey.server.model.ResourceModel.Builder
- Enclosing class:
- ResourceModel
Builder used to create
resource model instances.-
Constructor Summary
ConstructorsConstructorDescriptionBuilder(boolean subResourceModel) Create new builder with empty resources.Create new builder pre initialized withresource.Builder(ResourceModel resourceModel, boolean subResourceModel) Create new builder pre initialized withresourceModel. -
Method Summary
Modifier and TypeMethodDescriptionaddResource(Resource resource) Add a resource to the builder.build()Build theresource model.
-
Constructor Details
-
Builder
Create new builder pre initialized withresourceModel.- Parameters:
resourceModel- Resource model.subResourceModel-trueif resource model created by this builder will be sub resource model,falseif it is a application root resource model.
-
Builder
Create new builder pre initialized withresource.- Parameters:
resources- Resources (root and non root).subResourceModel-trueif resource model created by this builder will be sub resource model,falseif it is a application root resource model.
-
Builder
public Builder(boolean subResourceModel) Create new builder with empty resources.- Parameters:
subResourceModel-trueif resource model created by this builder will be sub resource model,falseif it is a application root resource model.
-
-
Method Details
-
addResource
Add a resource to the builder.- Parameters:
resource- Resource to be added to the builder (root or non root resource).- Returns:
- Current builder.
-
build
Build theresource model. Resources with the same path are merged.- Returns:
- Resource model.
-