Package spoon.reflect.visitor
Class PrintingContext
java.lang.Object
spoon.reflect.visitor.PrintingContext
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
boolean
boolean
boolean
isInCurrentScope(CtTypeReference<?> typeRef)
boolean
boolean
isStatement(CtStatement stmt)
modify()
Creates a new Writable instance, coping the current state and statement if set.void
Removes the current type context from the stack.void
pushCurrentThis(CtType<?> type)
Adds the given type to the stack of types.boolean
toString()
(non-Javadoc)
-
Constructor Details
-
PrintingContext
public PrintingContext()
-
-
Method Details
-
isFirstForVariable
public boolean isFirstForVariable()- Returns:
- true if we are printing first variable declaration of CtFor statement
-
isNextForVariable
public boolean isNextForVariable()- Returns:
- true if we are printing second or next variable declaration of CtFor statement
-
ignoreGenerics
public boolean ignoreGenerics()- Returns:
- true if we are ignore generics while printing statement, false otherwise.
-
skipArray
public boolean skipArray()- Returns:
- true if we skip the array brackets, false otherwise.
-
ignoreStaticAccess
public boolean ignoreStaticAccess()- Returns:
- true if we skip printing the static access, false otherwise.
-
ignoreEnclosingClass
public boolean ignoreEnclosingClass()- Returns:
- true if we skip printing the enclosing class, false access, false otherwise.
-
forceWildcardGenerics
public boolean forceWildcardGenerics()- Returns:
- true if we force printing the generic wildcard '?', false otherwise.
-
isStatement
- Returns:
- true if `stmt` has to be handled as statement in current printing context
-
getCurrentTypeReference
- Returns:
- the current top level type or null if no type is defined.
-
pushCurrentThis
Adds the given type to the stack of types.- Parameters:
type
- the type to add.
-
popCurrentThis
public void popCurrentThis()Removes the current type context from the stack. -
toString
(non-Javadoc)- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
isInCurrentScope
- Parameters:
typeRef
- used to check if we are in the context of this type.- Returns:
- true if typeRef is equal to current (actually printed) Type (currentThis)
-
modify
Creates a new Writable instance, coping the current state and statement if set.- Returns:
- a new
PrintingContext.Writable
instance.
-