public static class AnnotationType.Impl extends AnnotationType.Abstract
An implementation of AnnotationType
.
To build an instance of AnnotationType.Impl
,
first invoke the no-args constructor, and then use the
setPropertyConstraint method to build the property->constraint
mapping.
AnnotationType.Abstract, AnnotationType.Impl
ANY, NONE
Constructor and Description |
---|
AnnotationType.Impl()
Create a new Impl with no constraints.
|
AnnotationType.Impl(CollectionConstraint unknown)
Create a new Impl with a default collection constraint.
|
AnnotationType.Impl(PropertyConstraint defaultPC,
Location defaultCC)
Create a new Impl with a default property and cardinality constraint.
|
Modifier and Type | Method and Description |
---|---|
String |
getComment()
Get the comment for the whole AnnotationType.
|
String |
getComment(Object key)
Get the comment for a particular property.
|
CollectionConstraint |
getConstraint(Object key)
Retrieve the constraint that will be applied to all
properties with a given key.
|
CollectionConstraint |
getDefaultConstraint()
Get the CollectionConstraint that will be applied to all properties without
an explicit binding.
|
Set |
getProperties()
Retrieve the set of properties for which constraints have been explicity specified.
|
void |
setComment(Object key,
String comment)
Set the comment for a particular property.
|
void |
setComment(String comment)
Set the comment for the whole AnnotationType.
|
void |
setConstraint(Object key,
CollectionConstraint cc)
Specifies the constraint to apply to the specified property.
|
void |
setDefaultConstraint(CollectionConstraint cc)
Specifies the default constraint to apply to properties where no
other constraint is specified.
|
addProperty, getProperty, instanceOf, removeProperty, setConstraints, setDefaultConstraints, setProperty, subTypeOf, toString
public AnnotationType.Impl()
public AnnotationType.Impl(PropertyConstraint defaultPC, Location defaultCC)
defaultPC
- the default PropertyConstraintdefaultCC
- the default CardinalityConstraintpublic AnnotationType.Impl(CollectionConstraint unknown)
unknown
- the default CollectionConstraintpublic void setDefaultConstraint(CollectionConstraint cc)
AnnotationType
cc
- The default constraint.public CollectionConstraint getDefaultConstraint()
AnnotationType
If you want to find out exactly what constraint will be applied to properties with no explicitly defined constraints
public CollectionConstraint getConstraint(Object key)
AnnotationType
Retrieve the constraint that will be applied to all properties with a given key.
For an Annotation
to be accepted, each key in
getProperties() must be present in the annotation and each of the
values associated with those properties must match the
constraint.
key
- the property to be validated.public void setConstraint(Object key, CollectionConstraint cc)
AnnotationType
key
- the name of the property to constraincc
- the constraint to apply to this slot.public Set getProperties()
AnnotationType
public void setComment(String comment)
AnnotationType
comment
- the new commentpublic String getComment()
AnnotationType
public void setComment(Object key, String comment)
AnnotationType
key
- the property to comment oncomment
- the commentpublic String getComment(Object key)
AnnotationType
key
- the property to get a comment forCopyright © 2014 BioJava. All rights reserved.