Class ClassDeclarationTreeImpl
java.lang.Object
org.sonar.php.tree.impl.PHPTree
org.sonar.php.tree.impl.declaration.ClassDeclarationTreeImpl
- All Implemented Interfaces:
HasClassSymbol
,ClassDeclarationTree
,ClassTree
,HasAttributes
,StatementTree
,Tree
- Direct Known Subclasses:
EnumDeclarationTreeImpl
public class ClassDeclarationTreeImpl
extends PHPTree
implements ClassDeclarationTree, HasClassSymbol
-
Nested Class Summary
-
Field Summary
Fields inherited from interface org.sonar.plugins.php.api.tree.declaration.ClassTree
PHP5_CONSTRUCTOR_NAME
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ClassDeclarationTreeImpl
(Tree.Kind kind, List<AttributeGroupTree> attributeGroups, List<SyntaxToken> modifiersToken, SyntaxToken classEntryTypeToken, NameIdentifierTree name, SyntaxToken extendsToken, NamespaceNameTree superClass, SyntaxToken implementsToken, SeparatedListImpl<NamespaceNameTree> superInterfaces, SyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, SyntaxToken closeCurlyBraceToken) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(VisitorCheck visitor) Creates iterator for children of this node.static ClassDeclarationTree
createClass
(List<AttributeGroupTree> attributes, List<SyntaxToken> modifiersToken, InternalSyntaxToken classToken, NameIdentifierTree name, InternalSyntaxToken extendsToken, NamespaceNameTree superClass, InternalSyntaxToken implementsToken, SeparatedListImpl<NamespaceNameTree> superInterfaces, InternalSyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, InternalSyntaxToken closeCurlyBraceToken) static ClassDeclarationTree
createInterface
(List<AttributeGroupTree> attributes, InternalSyntaxToken interfaceToken, NameIdentifierTree name, InternalSyntaxToken extendsToken, SeparatedListImpl<NamespaceNameTree> interfaceList, InternalSyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, InternalSyntaxToken closeCurlyBraceToken) static ClassDeclarationTree
createTrait
(List<AttributeGroupTree> attributes, InternalSyntaxToken traitToken, NameIdentifierTree name, InternalSyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, InternalSyntaxToken closeCurlyBraceToken) Fetch class constructor declaration within classmembers
.getKind()
boolean
boolean
isFinal()
boolean
members()
name()
void
setSymbol
(ClassSymbol symbol) symbol()
Methods inherited from class org.sonar.php.tree.impl.PHPTree
getFirstToken, getLastToken, getLine, getParent, is, isLeaf, setParent, toString
-
Constructor Details
-
ClassDeclarationTreeImpl
protected ClassDeclarationTreeImpl(Tree.Kind kind, List<AttributeGroupTree> attributeGroups, List<SyntaxToken> modifiersToken, SyntaxToken classEntryTypeToken, NameIdentifierTree name, @Nullable SyntaxToken extendsToken, @Nullable NamespaceNameTree superClass, @Nullable SyntaxToken implementsToken, SeparatedListImpl<NamespaceNameTree> superInterfaces, SyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, SyntaxToken closeCurlyBraceToken)
-
-
Method Details
-
modifierToken
Description copied from interface:ClassDeclarationTree
- Specified by:
modifierToken
in interfaceClassDeclarationTree
-
modifiersToken
Description copied from interface:ClassDeclarationTree
- Specified by:
modifiersToken
in interfaceClassDeclarationTree
-
attributeGroups
- Specified by:
attributeGroups
in interfaceHasAttributes
-
classToken
Description copied from interface:ClassDeclarationTree
- Specified by:
classToken
in interfaceClassDeclarationTree
- Specified by:
classToken
in interfaceClassTree
-
name
- Specified by:
name
in interfaceClassDeclarationTree
-
extendsToken
- Specified by:
extendsToken
in interfaceClassDeclarationTree
- Specified by:
extendsToken
in interfaceClassTree
-
superClass
- Specified by:
superClass
in interfaceClassDeclarationTree
- Specified by:
superClass
in interfaceClassTree
-
implementsToken
- Specified by:
implementsToken
in interfaceClassDeclarationTree
- Specified by:
implementsToken
in interfaceClassTree
-
superInterfaces
- Specified by:
superInterfaces
in interfaceClassDeclarationTree
- Specified by:
superInterfaces
in interfaceClassTree
-
openCurlyBraceToken
- Specified by:
openCurlyBraceToken
in interfaceClassDeclarationTree
- Specified by:
openCurlyBraceToken
in interfaceClassTree
-
members
- Specified by:
members
in interfaceClassDeclarationTree
- Specified by:
members
in interfaceClassTree
-
closeCurlyBraceToken
- Specified by:
closeCurlyBraceToken
in interfaceClassDeclarationTree
- Specified by:
closeCurlyBraceToken
in interfaceClassTree
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstract
in interfaceClassDeclarationTree
-
isFinal
public boolean isFinal()- Specified by:
isFinal
in interfaceClassDeclarationTree
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnly
in interfaceClassDeclarationTree
-
fetchConstructor
Description copied from interface:ClassTree
Fetch class constructor declaration within classmembers
. Will look for a method named "__construct", if cannot be found it will search for the old-style constructor function, by the name of the class.- Specified by:
fetchConstructor
in interfaceClassTree
- Returns:
- the class constructor method declaration if defined, null otherwise.
-
getKind
-
childrenIterator
Description copied from class:PHPTree
Creates iterator for children of this node. Note that iterator may containnull
elements.- Specified by:
childrenIterator
in classPHPTree
-
accept
-
createInterface
public static ClassDeclarationTree createInterface(List<AttributeGroupTree> attributes, InternalSyntaxToken interfaceToken, NameIdentifierTree name, @Nullable InternalSyntaxToken extendsToken, SeparatedListImpl<NamespaceNameTree> interfaceList, InternalSyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, InternalSyntaxToken closeCurlyBraceToken) -
createTrait
public static ClassDeclarationTree createTrait(List<AttributeGroupTree> attributes, InternalSyntaxToken traitToken, NameIdentifierTree name, InternalSyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, InternalSyntaxToken closeCurlyBraceToken) -
createClass
public static ClassDeclarationTree createClass(List<AttributeGroupTree> attributes, List<SyntaxToken> modifiersToken, InternalSyntaxToken classToken, NameIdentifierTree name, @Nullable InternalSyntaxToken extendsToken, @Nullable NamespaceNameTree superClass, @Nullable InternalSyntaxToken implementsToken, SeparatedListImpl<NamespaceNameTree> superInterfaces, InternalSyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, InternalSyntaxToken closeCurlyBraceToken) -
symbol
- Specified by:
symbol
in interfaceHasClassSymbol
-
setSymbol
- Specified by:
setSymbol
in interfaceHasClassSymbol
-