Constructor and Description |
---|
IdType(String resourceType)
Constructor.
|
IdType(String[] resourceTypes,
String resourceTypeFieldName)
Constructor for the polymorphic resource ID case.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(TypeVisitor visitor)
Accepts a type visitor and dispatches to the appropriate visitor method,
depending on class of the individual type.
|
String |
getResourceType()
Returns the resource type for the
ID . |
String |
getResourceTypeFieldName()
Returns the field specifying the resource type for polymorphic
resource
ID in canonical form. |
List<String> |
getResourceTypes()
Returns the allowed resource types for polymorphic resource
ID . |
public IdType(String resourceType)
Creates an instance for given resource type, i.e. the value
of @Resource(...)
from the IDL
resourceType
- resource type of the ID;
must not be null
IllegalArgumentException
- if the resource type is
null
public IdType(String[] resourceTypes, String resourceTypeFieldName)
Creates an instance for given allowed resource types and resource
type field. This are the values specified at the
@Resource(String[] allowedTypes, typeFieldName)
in the IDL
resourceTypes
- the allowed resource typesresourceTypeFieldName
- the name of the field specifying the
resource typeIllegalArgumentException
- if both arguments are null
public void accept(TypeVisitor visitor)
Type
public String getResourceType()
ID
.String
representing the resource typepublic List<String> getResourceTypes()
ID
.List<String>
representing the resource typepublic String getResourceTypeFieldName()
ID
in canonical form.String
representing the resource typeCopyright © 2015. All Rights Reserved.