Interface IJavaCatchBlock


@Ser public interface IJavaCatchBlock
Interface to represent a catch-block used by IJavaTry AST elements.
  • Method Details

    • getType

      IJavaType getType()
      Retrieve the primary caught type.
      Returns:
      never null
    • setType

      void setType(IJavaType type)
      Set the primary caught type.
      Parameters:
      type - caught type
    • getCaughtTypes

      List<IJavaType> getCaughtTypes()
      Retrieve a read-only copy of the list of caught types.
      Returns:
      caught types
    • getAdditionalCaughtTypes

      List<IJavaType> getAdditionalCaughtTypes()
      For multi-catch (java >= 7), retrieve additional caught types.
      Returns:
      a list, possibly null
    • addTypes

      void addTypes(Collection<IJavaType> types)
      Add caught types.
      Parameters:
      types - caught types
    • addType

      void addType(IJavaType type)
      Add a caught type.
      Parameters:
      type - caught type
    • canCatch

      boolean canCatch(String typestring)
      Determine whether this block can catch a type.
      Parameters:
      typestring - type signature
      Returns:
      true if the provided type can be caught
    • setIdentifier

      void setIdentifier(IJavaIdentifier ident)
      Set the catch variable identifier.
      Parameters:
      ident - catch variable identifier
    • getIdentifier

      IJavaIdentifier getIdentifier()
      Retrieve the catch variable identifier.
      Returns:
      catch variable identifier
    • setDefifinition

      void setDefifinition(IJavaDefinition def)
      Set the catch variable definition.
      Parameters:
      def - catch variable definition
    • getDefinition

      IJavaDefinition getDefinition()
      Retrieve the catch variable definition.
      Returns:
      catch variable definition
    • setBlock

      void setBlock(IJavaBlock block)
      Set the catch body block.
      Parameters:
      block - catch body block
    • getBlock

      IJavaBlock getBlock()
      Retrieve the catch body block.
      Returns:
      catch body block