Class AttributeFactory

    • Field Detail

      • DEFAULT_ATTRIBUTE_FACTORY

        public static final AttributeFactory DEFAULT_ATTRIBUTE_FACTORY
        This is the default factory that creates AttributeImpls using the class name of the supplied Attribute interface class by appending Impl to it.
    • Constructor Detail

      • AttributeFactory

        public AttributeFactory()
    • Method Detail

      • getStaticImplementation

        public static <A extends AttributeImplAttributeFactory getStaticImplementation​(AttributeFactory delegate,
                                                                                         Class<A> clazz)
        Returns an AttributeFactory returning an instance of the given clazz for the attributes it implements. The given clazz must have a public no-arg constructor. For all other attributes it calls the given delegate factory as fallback. This method can be used to prefer a specific AttributeImpl which combines multiple attributes over separate classes.

        Please save instances created by this method in a static final field, because on each call, this does reflection for creating a MethodHandle.