Class HiddenFieldCheck.FieldFrame
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.FieldFrame
- Enclosing class:
- HiddenFieldCheck
Holds the names of static and instance fields of a type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
Name of the frame, such name of the class or enum declaration.Set of instance field names.private final HiddenFieldCheck.FieldFrame
Parent frame.Set of static field names.private final boolean
Is this a static inner type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
FieldFrame
(HiddenFieldCheck.FieldFrame parent, boolean staticType, String frameName) Creates new frame. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInstanceField
(String field) Adds an instance field to this FieldFrame.void
addStaticField
(String field) Adds a static field to this FieldFrame.boolean
containsInstanceField
(String field) Determines whether this FieldFrame contains an instance field.boolean
containsStaticField
(String field) Determines whether this FieldFrame contains a static field.Getter for parent frame.private boolean
isEmbeddedIn
(String classOrEnumName) Check if current frame is embedded in class or enum with specific name.
-
Field Details
-
frameName
Name of the frame, such name of the class or enum declaration. -
staticType
Is this a static inner type. -
parent
Parent frame. -
instanceFields
Set of instance field names. -
staticFields
Set of static field names.
-
-
Constructor Details
-
FieldFrame
Creates new frame.- Parameters:
parent
- parent frame.staticType
- is this a static inner type (class or enum).frameName
- name associated with the frame, which can be a
-
-
Method Details
-
addInstanceField
Adds an instance field to this FieldFrame.- Parameters:
field
- the name of the instance field.
-
addStaticField
Adds a static field to this FieldFrame.- Parameters:
field
- the name of the instance field.
-
containsInstanceField
Determines whether this FieldFrame contains an instance field.- Parameters:
field
- the field to check- Returns:
- true if this FieldFrame contains instance field
-
containsStaticField
Determines whether this FieldFrame contains a static field.- Parameters:
field
- the field to check- Returns:
- true if this FieldFrame contains static field
-
getParent
Getter for parent frame.- Returns:
- parent frame.
-
isEmbeddedIn
Check if current frame is embedded in class or enum with specific name.- Parameters:
classOrEnumName
- name of class or enum that we are looking for in the chain of field frames.- Returns:
- true if current frame is embedded in class or enum with name classOrNameName
-