Top Description Methods
com.github.javaparser.ast.nodeTypes

public Interface NodeWithDeclaration

Known Direct Implementers
com.github.javaparser.ast.body.CallableDeclaration, com.github.javaparser.ast.body.MethodDeclaration

Node with a declaration representable as a String.
Author
Federico Tomassetti
Since
July 2014

Method Summary

Modifier and TypeMethod and Description
public default String

Returns:

String representation of declaration
getDeclarationAsString
()

As NodeWithDeclaration#getDeclarationAsString(boolean, boolean, boolean) including the modifiers, the throws clause and the parameters with both type and name.

public default String

Returns:

String representation of declaration based on parameter flags
getDeclarationAsString
(boolean
flag to include the modifiers (if present) in the string produced
includingModifiers
,
boolean
flag to include the throws clause (if present) in the string produced
includingThrows
)

As NodeWithDeclaration#getDeclarationAsString(boolean, boolean, boolean) including the parameters with both type and name.

public String

Returns:

String representation of declaration based on parameter flags
getDeclarationAsString
(boolean
flag to include the modifiers (if present) in the string produced
includingModifiers
,
boolean
flag to include the throws clause (if present) in the string produced
includingThrows
,
boolean
flag to include the parameter name (while the parameter type is always included) in the string produced
includingParameterName
)

A simple representation of the element declaration.

Method Detail

getDeclarationAsStringback to summary
public default String getDeclarationAsString()

As NodeWithDeclaration#getDeclarationAsString(boolean, boolean, boolean) including the modifiers, the throws clause and the parameters with both type and name.

Returns:String

String representation of declaration

getDeclarationAsStringback to summary
public default String getDeclarationAsString(boolean includingModifiers, boolean includingThrows)

As NodeWithDeclaration#getDeclarationAsString(boolean, boolean, boolean) including the parameters with both type and name.

Parameters
includingModifiers:boolean

flag to include the modifiers (if present) in the string produced

includingThrows:boolean

flag to include the throws clause (if present) in the string produced

Returns:String

String representation of declaration based on parameter flags

getDeclarationAsStringback to summary
public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName)

A simple representation of the element declaration. It should fit one string.

Parameters
includingModifiers:boolean

flag to include the modifiers (if present) in the string produced

includingThrows:boolean

flag to include the throws clause (if present) in the string produced

includingParameterName:boolean

flag to include the parameter name (while the parameter type is always included) in the string produced

Returns:String

String representation of declaration based on parameter flags