/** Create descriptor for passed type. */ public static ComponentDescriptor create(Class<? extends Component> type, FluidGeneratorPreferences globalPreferences) { String methodPrefix = Strings.decapitalizeString(type.getSimpleName()); String name = type.getSimpleName(); FluidGeneratorPreferences preferences = new FluidGeneratorPreferences(); preferences.mirror(globalPreferences); // @todo make sure this is processed from least to most pressing. for (Annotation annotation : ExtendedTypeReflection.getAllAnnotations(type)) { if (annotation.annotationType().equals(Fluid.class)) { final Fluid fluid = (Fluid) annotation; if (!fluid.name().isEmpty()) { methodPrefix = fluid.name(); name = Strings.capitalizeString(fluid.name()); } preferences.apply(fluid); } } return new ComponentDescriptor(type, methodPrefix, name, preferences ); }
/** Create descriptor for passed type. */ public static ComponentDescriptor create(Class<? extends Component> type, FluidGeneratorPreferences globalPreferences) { String methodPrefix = Strings.decapitalizeString(type.getSimpleName()); String name = type.getSimpleName(); FluidGeneratorPreferences preferences = new FluidGeneratorPreferences(); preferences.mirror(globalPreferences); // @todo make sure this is processed from least to most pressing. for (Annotation annotation : ExtendedTypeReflection.getAllAnnotations(type)) { if (annotation.annotationType().equals(Fluid.class)) { final Fluid fluid = (Fluid) annotation; if (!fluid.name().isEmpty()) { methodPrefix = fluid.name(); name = Strings.capitalizeString(fluid.name()); } preferences.apply(fluid); } } return new ComponentDescriptor(type, methodPrefix, name, preferences ); }