Skip to content

Package io.github.sandydunlop.markista.model

Class AbstractMember

java.lang.Object
        io.github.sandydunlop.markista.model.Node
                io.github.sandydunlop.markista.model.AbstractMember


public abstract class AbstractMember

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 Set<Modifier> modifiers A list of the modifiers a node has
protected String simpleName The simple form of the name
protected String qualifiedName The qualified form of the name
protected String packageName A PackageNode representing the package the node belongs to
private final List<AppliedAnnotationNode> appliedAnnotations List of annotations applied to this type.
private boolean hasDocumentedAnnotation Has the @Documented annotation applied

Constructor Summary

Constructor Description
AbstractMember()

Method Summary

Modifier and Type Method Description
public void setSimpleName(String name) Sets the simple name of this type.
public String getSimpleName() Returns the simple name of this type.
public void setQualifiedName(String name) Sets the qualified name of this type.
public String getQualifiedName() Returns the qualified 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 void setHasDocumentedAnnotation(boolean b) Sets a flag indicating if this type as having a @Documented meta-annotation
public boolean hasDocumentedAnnotation() Does this type have a @Documented meta-annotation?
public String getModifiersString() Returns a string representation of modifiers.

Field Details

modifiers

private final Set<Modifier> modifiers

A list of the modifiers a node has


simpleName

protected String simpleName

The simple form of the name


qualifiedName

protected String qualifiedName

The qualified form of the name


packageName

protected String packageName

A PackageNode representing the package the node belongs to


appliedAnnotations

private final List<AppliedAnnotationNode> appliedAnnotations

List of annotations applied to this type.


hasDocumentedAnnotation

private boolean hasDocumentedAnnotation

Has the @Documented annotation applied


Method Details

setSimpleName

public void setSimpleName

Sets the simple name of this type.


getSimpleName

public String getSimpleName

Returns the simple name of this type.

Returns:

the simple name.


setQualifiedName

public void setQualifiedName

Sets the qualified name of this type.


getQualifiedName

public String getQualifiedName

Returns the qualified name of this type.

Returns:

the qualified name.


addModifier

public void addModifier

Adds a modifier to the set of modifiers.


getModifiers

public Set<Modifier> getModifiers

Returns the set of modifiers for this node.

Returns:

Set of modifiers.


addAppliedAnnotation

public void addAppliedAnnotation

Adds an applied annotation to this type


getAppliedAnnotations

public List<AppliedAnnotationNode> getAppliedAnnotations

Returns the list of annotations applied to this type.

Returns:

list of applied annotations


setHasDocumentedAnnotation

public void setHasDocumentedAnnotation

Sets a flag indicating if this type as having a @Documented meta-annotation


hasDocumentedAnnotation

public boolean hasDocumentedAnnotation

Does this type have a @Documented meta-annotation?

Returns:

True if it has a @Documented meta-annotation


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.