public static class MultiGraphQualifierHierarchy.MultiGraphFactory extends Object
GraphQualifierHierarchy.
A factory can be used to create at most one GraphQualifierHierarchy.
To create a hierarchy, a client may do so in three steps:
1. add qualifiers using addQualifier(AnnotationMirror);
2. add subtype relations using addSubtype(AnnotationMirror, AnnotationMirror)
3. build the hierarchy and gets using build().
Notice that addSubtype(AnnotationMirror, AnnotationMirror) adds
the two qualifiers to the hierarchy if they are not already in.
Also, once the client builds a hierarchy through build(),
no further modifications are allowed nor can it making a new instance.
Clients build the hierarchy using addQualifier(AnnotationMirror)
and addSubtype(AnnotationMirror, AnnotationMirror), then get
the instance with calling build()| Modifier and Type | Field and Description |
|---|---|
protected AnnotatedTypeFactory |
atypeFactory |
protected Map<AnnotationMirror,AnnotationMirror> |
polyQualifiers
Map from qualifier hierarchy to the corresponding polymorphic qualifier.
|
protected Map<AnnotationMirror,Set<AnnotationMirror>> |
supertypes
Map from qualifiers to the direct supertypes of the qualifier.
|
| Constructor and Description |
|---|
MultiGraphFactory(AnnotatedTypeFactory atypeFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addQualifier(AnnotationMirror qual)
Adds the passed qualifier to the hierarchy.
|
void |
addSubtype(AnnotationMirror sub,
AnnotationMirror sup)
Adds a subtype relationship between the two type qualifiers.
|
protected void |
assertNotBuilt() |
QualifierHierarchy |
build()
Returns an instance of
GraphQualifierHierarchy that
represents the hierarchy built so far |
protected QualifierHierarchy |
createQualifierHierarchy() |
protected final Map<AnnotationMirror,Set<AnnotationMirror>> supertypes
protected final Map<AnnotationMirror,AnnotationMirror> polyQualifiers
protected final AnnotatedTypeFactory atypeFactory
public MultiGraphFactory(AnnotatedTypeFactory atypeFactory)
public void addQualifier(AnnotationMirror qual)
addSubtype(AnnotationMirror, AnnotationMirror).public void addSubtype(AnnotationMirror sub, AnnotationMirror sup)
sub - the sub type qualifiersup - the super type qualifierpublic QualifierHierarchy build()
GraphQualifierHierarchy that
represents the hierarchy built so farprotected QualifierHierarchy createQualifierHierarchy()
protected void assertNotBuilt()