Interface IJavaCatchBlock
Interface to represent a catch-block used by
IJavaTry AST elements.-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a caught type.voidaddTypes(Collection<IJavaType> types) Add caught types.booleanDetermine whether this block can catch a type.For multi-catch (java >= 7), retrieve additional caught types.getBlock()Retrieve the catch body block.Retrieve a read-only copy of the list of caught types.Retrieve the catch variable definition.Retrieve the catch variable identifier.getType()Retrieve the primary caught type.voidsetBlock(IJavaBlock block) Set the catch body block.voidSet the catch variable definition.voidsetIdentifier(IJavaIdentifier ident) Set the catch variable identifier.voidSet the primary caught type.
-
Method Details
-
getType
IJavaType getType()Retrieve the primary caught type.- Returns:
- never null
-
setType
Set the primary caught type.- Parameters:
type- caught type
-
getCaughtTypes
Retrieve a read-only copy of the list of caught types.- Returns:
- caught types
-
getAdditionalCaughtTypes
For multi-catch (java >= 7), retrieve additional caught types.- Returns:
- a list, possibly null
-
addTypes
Add caught types.- Parameters:
types- caught types
-
addType
Add a caught type.- Parameters:
type- caught type
-
canCatch
Determine whether this block can catch a type.- Parameters:
typestring- type signature- Returns:
- true if the provided type can be caught
-
setIdentifier
Set the catch variable identifier.- Parameters:
ident- catch variable identifier
-
getIdentifier
IJavaIdentifier getIdentifier()Retrieve the catch variable identifier.- Returns:
- catch variable identifier
-
setDefifinition
Set the catch variable definition.- Parameters:
def- catch variable definition
-
getDefinition
IJavaDefinition getDefinition()Retrieve the catch variable definition.- Returns:
- catch variable definition
-
setBlock
Set the catch body block.- Parameters:
block- catch body block
-
getBlock
IJavaBlock getBlock()Retrieve the catch body block.- Returns:
- catch body block
-