/** * @deprecated Since 2.9; use {@link #getFactoryMethods} instead. */ @Deprecated public List<AnnotatedMethod> getStaticMethods() { return getFactoryMethods(); }
@Override public List<AnnotatedMethod> getFactoryMethods() { // must filter out anything that clearly is not a factory method List<AnnotatedMethod> candidates = _classInfo.getFactoryMethods(); if (candidates.isEmpty()) { return candidates; } List<AnnotatedMethod> result = null; for (AnnotatedMethod am : candidates) { if (isFactoryMethod(am)) { if (result == null) { result = new ArrayList<AnnotatedMethod>(); } result.add(am); } } if (result == null) { return Collections.emptyList(); } return result; }
@Override public Method findFactoryMethod(Class<?>... expArgTypes) { // So, of all single-arg static methods: for (AnnotatedMethod am : _classInfo.getFactoryMethods()) { // 24-Oct-2016, tatu: Better ensure it only takes 1 arg, no matter what if (isFactoryMethod(am) && am.getParameterCount() == 1) { // And must take one of expected arg types (or supertype) Class<?> actualArgType = am.getRawParameterType(0); for (Class<?> expArgType : expArgTypes) { // And one that matches what we would pass in if (actualArgType.isAssignableFrom(expArgType)) { return am.getAnnotated(); } } } } return null; }
protected AnnotatedMethod _findFactory(AnnotatedClass cls, String name, Class<?>... argTypes) { final int argCount = argTypes.length; for (AnnotatedMethod method : cls.getFactoryMethods()) { if (!name.equals(method.getName()) || (method.getParameterCount() != argCount)) { continue; } for (int i = 0; i < argCount; ++i) { Class<?> argType = method.getParameter(i).getRawType(); if (!argType.isAssignableFrom(argTypes[i])) { continue; } } return method; } return null; } }
protected AnnotatedMethod _findFactory(AnnotatedClass cls, String name, Class<?>... argTypes) { final int argCount = argTypes.length; for (AnnotatedMethod method : cls.getFactoryMethods()) { if (!name.equals(method.getName()) || (method.getParameterCount() != argCount)) { continue; } for (int i = 0; i < argCount; ++i) { Class<?> argType = method.getParameter(i).getRawType(); if (!argType.isAssignableFrom(argTypes[i])) { continue; } } return method; } return null; } }
/** * Method for collecting basic information on constructor(s) found */ protected void _addCreators(Map<String, POJOPropertyBuilder> props) { // can be null if annotation processing is disabled... if (!_useAnnotations) { return; } for (AnnotatedConstructor ctor : _classDef.getConstructors()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { _addCreatorParam(props, ctor.getParameter(i)); } } for (AnnotatedMethod factory : _classDef.getFactoryMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = factory.getParameterCount(); i < len; ++i) { _addCreatorParam(props, factory.getParameter(i)); } } }
/** * @deprecated Since 2.9; use {@link #getFactoryMethods} instead. */ @Deprecated public List<AnnotatedMethod> getStaticMethods() { return getFactoryMethods(); }
@Override public List<AnnotatedMethod> getFactoryMethods() { // must filter out anything that clearly is not a factory method List<AnnotatedMethod> candidates = _classInfo.getFactoryMethods(); if (candidates.isEmpty()) { return candidates; } List<AnnotatedMethod> result = null; for (AnnotatedMethod am : candidates) { if (isFactoryMethod(am)) { if (result == null) { result = new ArrayList<AnnotatedMethod>(); } result.add(am); } } if (result == null) { return Collections.emptyList(); } return result; }
protected AnnotatedMethod _findFactory(final AnnotatedClass cls, final String name, final Class... argTypes) { final int argCount = argTypes.length; final Iterator var5 = cls.getFactoryMethods().iterator(); AnnotatedMethod method; do { if (!var5.hasNext()) { return null; } method = (AnnotatedMethod) var5.next(); } while (!name.equals(method.getName()) || method.getParameterCount() != argCount); for (int i = 0; i < argCount; ++i) { final Class<?> argType = method.getParameter(i).getRawType(); if (!argType.isAssignableFrom(argTypes[i])) { ; } } return method; } }
protected AnnotatedMethod _findFactory(final AnnotatedClass cls, final String name, final Class... argTypes) { final int argCount = argTypes.length; final Iterator var5 = cls.getFactoryMethods().iterator(); AnnotatedMethod method; do { if (!var5.hasNext()) { return null; } method = (AnnotatedMethod) var5.next(); } while (!name.equals(method.getName()) || method.getParameterCount() != argCount); for (int i = 0; i < argCount; ++i) { final Class<?> argType = method.getParameter(i).getRawType(); if (!argType.isAssignableFrom(argTypes[i])) { ; } } return method; } }
@Override public Method findFactoryMethod(Class<?>... expArgTypes) { // So, of all single-arg static methods: for (AnnotatedMethod am : _classInfo.getFactoryMethods()) { // 24-Oct-2016, tatu: Better ensure it only takes 1 arg, no matter what if (isFactoryMethod(am) && am.getParameterCount() == 1) { // And must take one of expected arg types (or supertype) Class<?> actualArgType = am.getRawParameterType(0); for (Class<?> expArgType : expArgTypes) { // And one that matches what we would pass in if (actualArgType.isAssignableFrom(expArgType)) { return am.getAnnotated(); } } } } return null; }
/** * Method for collecting basic information on constructor(s) found */ protected void _addCreators(Map<String, POJOPropertyBuilder> props) { // can be null if annotation processing is disabled... if (!_useAnnotations) { return; } for (AnnotatedConstructor ctor : _classDef.getConstructors()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { _addCreatorParam(props, ctor.getParameter(i)); } } for (AnnotatedMethod factory : _classDef.getFactoryMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = factory.getParameterCount(); i < len; ++i) { _addCreatorParam(props, factory.getParameter(i)); } } }