Package com.google.auto.factory
Annotation Type AutoFactory
-
@Target({TYPE,CONSTRUCTOR}) public @interface AutoFactory
An annotation to be applied to elements for which a factory should be automatically generated.Visibility
The visibility of the generated factories will always be either
publicor default visibility. The visibility of any given factory method is determined by the visibility of the type being created. The generated factory ispublicif any of the factory methods are. Any method that implements an interface method is necessarily public and any method that overrides an abstract method has the same visibility as that method.- Author:
- Gregory Kick
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanallowSubclassesWhether or not the generated factory should be final.StringclassNameThe simple name of the generated factory; the factory is always generated in the same package as the annotated type.Class<?>extendingThe type that the generated factory is require to extend.Class<?>[]implementingA list of interfaces that the generated factory is required to implement.
-
-
-
Element Detail
-
className
String className
The simple name of the generated factory; the factory is always generated in the same package as the annotated type. The default value (the empty string) will result in a factory with the name of the type being created withFactoryappended to the end. For example, the default name for a factory forMyTypewill beMyTypeFactory.If the annotated type is nested, then the generated factory's name will start with the enclosing type names, separated by underscores. For example, the default name for a factory for
Outer.Inner.ReallyInnerisOuter_Inner_ReallyInnerFactory. IfclassNameisFoo, then the factory name isOuter_Inner_Foo.- Default:
- ""
-
-
-
implementing
Class<?>[] implementing
A list of interfaces that the generated factory is required to implement.- Default:
- {}
-
-
-
extending
Class<?> extending
The type that the generated factory is require to extend.- Default:
- java.lang.Object.class
-
-