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
public class ClassDeclarationTreeImpl extends PHPTree implements ClassDeclarationTree, HasClassSymbol
-
-
Field Summary
-
Fields inherited from interface org.sonar.plugins.php.api.tree.declaration.ClassTree
PHP5_CONSTRUCTOR_NAME
-
-
Method Summary
-
Methods inherited from class org.sonar.php.tree.impl.PHPTree
getFirstToken, getLastToken, getLine, getParent, is, isLeaf, setParent, toString
-
-
-
-
Method Detail
-
modifierToken
@Nullable public SyntaxToken modifierToken()
Description copied from interface:ClassDeclarationTree
- Specified by:
modifierToken
in interfaceClassDeclarationTree
-
attributeGroups
public List<AttributeGroupTree> attributeGroups()
- Specified by:
attributeGroups
in interfaceHasAttributes
-
classToken
public SyntaxToken classToken()
Description copied from interface:ClassDeclarationTree
- Specified by:
classToken
in interfaceClassDeclarationTree
- Specified by:
classToken
in interfaceClassTree
-
name
public NameIdentifierTree name()
- Specified by:
name
in interfaceClassDeclarationTree
-
extendsToken
@Nullable public SyntaxToken extendsToken()
- Specified by:
extendsToken
in interfaceClassDeclarationTree
- Specified by:
extendsToken
in interfaceClassTree
-
superClass
@Nullable public NamespaceNameTree superClass()
- Specified by:
superClass
in interfaceClassDeclarationTree
- Specified by:
superClass
in interfaceClassTree
-
implementsToken
@Nullable public SyntaxToken implementsToken()
- Specified by:
implementsToken
in interfaceClassDeclarationTree
- Specified by:
implementsToken
in interfaceClassTree
-
superInterfaces
public SeparatedListImpl<NamespaceNameTree> superInterfaces()
- Specified by:
superInterfaces
in interfaceClassDeclarationTree
- Specified by:
superInterfaces
in interfaceClassTree
-
openCurlyBraceToken
public SyntaxToken openCurlyBraceToken()
- Specified by:
openCurlyBraceToken
in interfaceClassDeclarationTree
- Specified by:
openCurlyBraceToken
in interfaceClassTree
-
members
public List<ClassMemberTree> members()
- Specified by:
members
in interfaceClassDeclarationTree
- Specified by:
members
in interfaceClassTree
-
closeCurlyBraceToken
public SyntaxToken closeCurlyBraceToken()
- Specified by:
closeCurlyBraceToken
in interfaceClassDeclarationTree
- Specified by:
closeCurlyBraceToken
in interfaceClassTree
-
fetchConstructor
@Nullable public MethodDeclarationTree 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.
-
childrenIterator
public Iterator<Tree> 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
public void accept(VisitorCheck visitor)
-
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, @Nullable InternalSyntaxToken modifierToken, InternalSyntaxToken classToken, NameIdentifierTree name, @Nullable InternalSyntaxToken extendsToken, @Nullable NamespaceNameTree superClass, @Nullable InternalSyntaxToken implementsToken, SeparatedListImpl<NamespaceNameTree> superInterfaces, InternalSyntaxToken openCurlyBraceToken, List<ClassMemberTree> members, InternalSyntaxToken closeCurlyBraceToken)
-
symbol
public ClassSymbol symbol()
- Specified by:
symbol
in interfaceHasClassSymbol
-
setSymbol
public void setSymbol(ClassSymbol symbol)
- Specified by:
setSymbol
in interfaceHasClassSymbol
-
-