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
ConstructorsModifierConstructorDescriptionprotectedClassDeclarationTreeImpl(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 TypeMethodDescriptionvoidaccept(VisitorCheck visitor) Creates iterator for children of this node.static ClassDeclarationTreecreateClass(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 ClassDeclarationTreecreateInterface(List<AttributeGroupTree> attributes, InternalSyntaxToken interfaceToken, NameIdentifierTree name, InternalSyntaxToken extendsToken, SeparatedListImpl<NamespaceNameTree> interfaceList, InternalSyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, InternalSyntaxToken closeCurlyBraceToken) static ClassDeclarationTreecreateTrait(List<AttributeGroupTree> attributes, InternalSyntaxToken traitToken, NameIdentifierTree name, InternalSyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, InternalSyntaxToken closeCurlyBraceToken) Fetch class constructor declaration within classmembers.getKind()booleanbooleanisFinal()booleanmembers()name()voidsetSymbol(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:
modifierTokenin interfaceClassDeclarationTree
-
modifiersToken
Description copied from interface:ClassDeclarationTree- Specified by:
modifiersTokenin interfaceClassDeclarationTree
-
attributeGroups
- Specified by:
attributeGroupsin interfaceHasAttributes
-
classToken
Description copied from interface:ClassDeclarationTree- Specified by:
classTokenin interfaceClassDeclarationTree- Specified by:
classTokenin interfaceClassTree
-
name
- Specified by:
namein interfaceClassDeclarationTree
-
extendsToken
- Specified by:
extendsTokenin interfaceClassDeclarationTree- Specified by:
extendsTokenin interfaceClassTree
-
superClass
- Specified by:
superClassin interfaceClassDeclarationTree- Specified by:
superClassin interfaceClassTree
-
implementsToken
- Specified by:
implementsTokenin interfaceClassDeclarationTree- Specified by:
implementsTokenin interfaceClassTree
-
superInterfaces
- Specified by:
superInterfacesin interfaceClassDeclarationTree- Specified by:
superInterfacesin interfaceClassTree
-
openCurlyBraceToken
- Specified by:
openCurlyBraceTokenin interfaceClassDeclarationTree- Specified by:
openCurlyBraceTokenin interfaceClassTree
-
members
- Specified by:
membersin interfaceClassDeclarationTree- Specified by:
membersin interfaceClassTree
-
closeCurlyBraceToken
- Specified by:
closeCurlyBraceTokenin interfaceClassDeclarationTree- Specified by:
closeCurlyBraceTokenin interfaceClassTree
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstractin interfaceClassDeclarationTree
-
isFinal
public boolean isFinal()- Specified by:
isFinalin interfaceClassDeclarationTree
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnlyin interfaceClassDeclarationTree
-
fetchConstructor
Description copied from interface:ClassTreeFetch 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:
fetchConstructorin interfaceClassTree- Returns:
- the class constructor method declaration if defined, null otherwise.
-
getKind
-
childrenIterator
Description copied from class:PHPTreeCreates iterator for children of this node. Note that iterator may containnullelements.- Specified by:
childrenIteratorin 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:
symbolin interfaceHasClassSymbol
-
setSymbol
- Specified by:
setSymbolin interfaceHasClassSymbol
-