Enum CachedReturnPlugin.AdviceResolver

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOOLEAN
      A resolver for a boolean type.
      BYTE
      A resolver for a byte type.
      CHARACTER
      A resolver for a char type.
      DOUBLE
      A resolver for a double type.
      FLOAT
      A resolver for a float type.
      INTEGER
      A resolver for a int type.
      LONG
      A resolver for a long type.
      REFERENCE
      A resolver for a reference type.
      SHORT
      A resolver for a short type.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private DynamicType dynamicType
      The created dynamic type to use for advice.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private AdviceResolver​(java.lang.Class<?> type, int load, int store, int convert, int branch)
      Creates an advice resolver.
    • Field Detail

      • dynamicType

        private final DynamicType dynamicType
        The created dynamic type to use for advice.
    • Constructor Detail

      • AdviceResolver

        private AdviceResolver​(java.lang.Class<?> type,
                               int load,
                               int store,
                               int convert,
                               int branch)
        Creates an advice resolver.
        Parameters:
        type - The type of the return type.
        load - The byte code that loads a value onto the stack from the local variable array.
        store - The byte code that stores a value to the local variable array.
        convert - An instruction to convert the cached value to a value that is applied on the branch instruction.
        branch - A jump instruction that checks if the cached value is already set.
    • Method Detail

      • values

        public static CachedReturnPlugin.AdviceResolver[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CachedReturnPlugin.AdviceResolver c : CachedReturnPlugin.AdviceResolver.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CachedReturnPlugin.AdviceResolver valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • of

        protected static CachedReturnPlugin.AdviceResolver of​(TypeDefinition typeDefinition)
        Creates an advice resolver for a given type definition.
        Parameters:
        typeDefinition - The type definition for which advice is to be created.
        Returns:
        An appropriate advice resolver.
      • toAdvice

        protected Advice toAdvice​(java.lang.String name)
        Resolve advice for a given field name.
        Parameters:
        name - The name of the field to resolve the advice for.
        Returns:
        An appropriate advice.