Package io.github.sandydunlop.markista.model
Class AbstractMember
java.lang.Object
io.github.sandydunlop.markista.model.Node
io.github.sandydunlop.markista.model.AbstractMember
Direct Known Subtypes:
MethodNode, ParamNode, TypeNode
public abstract class AbstractMember
extends Node
Nested Class Summary
| Modifier and Type | Class | Description |
|---|---|---|
| public static | AbstractMember.ModifierSorter | Utility class to sort modifiers according to Java language conventions. |
Field Summary
| Modifier and Type | Field | Description |
|---|---|---|
| private final List<AppliedAnnotationNode> | appliedAnnotations | List of annotations applied to this type. |
| private final Set<Modifier> | modifiers | A list of the modifiers a node has |
| protected Name | name | The name of this program element |
| protected String | packageName | A String representing the package the node belongs to |
Constructor Summary
| Constructor | Description |
|---|---|
| AbstractMember() |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
| public void | setPackageName(String name) | Sets the package name of this type. |
| public String | getPackageName() | Returns the package name of this type. |
| public void | setName(Name name) | Sets the name of this type. |
| public Name | getName() | Returns the name of this type. |
| public void | addModifier(Modifier mod) | Adds a modifier to the set of modifiers. |
| public Set<Modifier> | getModifiers() | Returns the set of modifiers for this node. |
| public void | addAppliedAnnotation(AppliedAnnotationNode annotation) | Adds an applied annotation to this type |
| public List<AppliedAnnotationNode> | getAppliedAnnotations() | Returns the list of annotations applied to this type. |
| public String | getModifiersString() | Returns a string representation of modifiers. |
Methods inherited from Node
setReferences, getReferences, getKind, setDeprecationText, getBody, getSince, setFirstSentence, setSince, setBody, setDeprecation, getFirstSentence, setKind, getDeprecation, getUUID, getDeprecationText, getFullBody
Field Details
appliedAnnotations
private final List<AppliedAnnotationNode> appliedAnnotations
List of annotations applied to this type.
modifiers
private final Set<Modifier> modifiers
A list of the modifiers a node has
name
protected Name name
The name of this program element
packageName
protected String packageName
A String representing the package the node belongs to
Method Details
setPackageName
public void setPackageName(String name)
Sets the package name of this type.
Parameters:
name - the package name to set.
getPackageName
public String getPackageName()
Returns the package name of this type.
Returns:
the package name.
setName
public void setName(Name name)
Sets the name of this type.
Parameters:
name - the name to set.
getName
public Name getName()
Returns the name of this type.
Returns:
the name.
addModifier
public void addModifier(Modifier mod)
Adds a modifier to the set of modifiers.
Parameters:
mod - The modifier to add.
getModifiers
public Set<Modifier> getModifiers()
Returns the set of modifiers for this node.
Returns:
Set of modifiers.
addAppliedAnnotation
public void addAppliedAnnotation(AppliedAnnotationNode annotation)
Adds an applied annotation to this type
Parameters:
annotation - the annotation
getAppliedAnnotations
public List<AppliedAnnotationNode> getAppliedAnnotations()
Returns the list of annotations applied to this type.
Returns:
list of applied annotations
getModifiersString
public String getModifiersString()
Returns a string representation of modifiers.The modifiers are sorted according to a predefined order.
Returns:
A string containing sorted modifiers separated by spaces.