protected AnnotatedMethod _findFactory(AnnotatedClass cls, String name, Class<?>... argTypes) { final int argCount = argTypes.length; for (AnnotatedMethod method : cls.getStaticMethods()) { 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; } }
@Override public List<AnnotatedMethod> getFactoryMethods() { // must filter out anything that clearly is not a factory method List<AnnotatedMethod> candidates = _classInfo.getStaticMethods(); if (candidates.isEmpty()) { return candidates; } ArrayList<AnnotatedMethod> result = new ArrayList<AnnotatedMethod>(); for (AnnotatedMethod am : candidates) { if (isFactoryMethod(am)) { result.add(am); } } return result; }
@Override public List<AnnotatedMethod> getFactoryMethods() { // must filter out anything that clearly is not a factory method List<AnnotatedMethod> candidates = _classInfo.getStaticMethods(); if (candidates.isEmpty()) { return candidates; } ArrayList<AnnotatedMethod> result = new ArrayList<AnnotatedMethod>(); for (AnnotatedMethod am : candidates) { if (isFactoryMethod(am)) { result.add(am); } } return result; }
@Override public List<AnnotatedMethod> getFactoryMethods() { // must filter out anything that clearly is not a factory method List<AnnotatedMethod> candidates = _classInfo.getStaticMethods(); if (candidates.isEmpty()) { return candidates; } ArrayList<AnnotatedMethod> result = new ArrayList<AnnotatedMethod>(); for (AnnotatedMethod am : candidates) { if (isFactoryMethod(am)) { result.add(am); } } return result; }
@Override public List<AnnotatedMethod> getFactoryMethods() { // must filter out anything that clearly is not a factory method List<AnnotatedMethod> candidates = _classInfo.getStaticMethods(); if (candidates.isEmpty()) { return candidates; } ArrayList<AnnotatedMethod> result = new ArrayList<AnnotatedMethod>(); for (AnnotatedMethod am : candidates) { if (isFactoryMethod(am)) { result.add(am); } } return result; }
@Override public List<AnnotatedMethod> getFactoryMethods() { // must filter out anything that clearly is not a factory method List<AnnotatedMethod> candidates = _classInfo.getStaticMethods(); if (candidates.isEmpty()) { return candidates; } ArrayList<AnnotatedMethod> result = new ArrayList<AnnotatedMethod>(); for (AnnotatedMethod am : candidates) { if (isFactoryMethod(am)) { result.add(am); } } return result; }
@Override public Method findFactoryMethod(Class<?>... expArgTypes) { // So, of all single-arg static methods: for (AnnotatedMethod am : _classInfo.getStaticMethods()) { if (isFactoryMethod(am)) { // 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; }
@Override public Method findFactoryMethod(Class<?>... expArgTypes) { // So, of all single-arg static methods: for (AnnotatedMethod am : _classInfo.getStaticMethods()) { if (isFactoryMethod(am)) { // 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; }
@Override public Method findFactoryMethod(Class<?>... expArgTypes) { // So, of all single-arg static methods: for (AnnotatedMethod am : _classInfo.getStaticMethods()) { if (isFactoryMethod(am)) { // 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; }
@Override public Method findFactoryMethod(Class<?>... expArgTypes) { // So, of all single-arg static methods: for (AnnotatedMethod am : _classInfo.getStaticMethods()) { if (isFactoryMethod(am)) { // 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.getStaticMethods()) { 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.getStaticMethods()) { 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.getStaticMethods()) { 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.getStaticMethods()) { 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; } }
@Override public Method findFactoryMethod(Class<?>... expArgTypes) { // So, of all single-arg static methods: for (AnnotatedMethod am : _classInfo.getStaticMethods()) { // 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() { // can be null if annotation processing is disabled... if (_annotationIntrospector != null) { for (AnnotatedConstructor ctor : _classDef.getConstructors()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { _addCreatorParam(ctor.getParameter(i)); } } for (AnnotatedMethod factory : _classDef.getStaticMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = factory.getParameterCount(); i < len; ++i) { _addCreatorParam(factory.getParameter(i)); } } } }
/** * Method for collecting basic information on constructor(s) found */ protected void _addCreators() { // can be null if annotation processing is disabled... if (_annotationIntrospector != null) { for (AnnotatedConstructor ctor : _classDef.getConstructors()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { _addCreatorParam(ctor.getParameter(i)); } } for (AnnotatedMethod factory : _classDef.getStaticMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = factory.getParameterCount(); i < len; ++i) { _addCreatorParam(factory.getParameter(i)); } } } }
/** * 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 (_annotationIntrospector == null) { 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.getStaticMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = factory.getParameterCount(); i < len; ++i) { _addCreatorParam(props, factory.getParameter(i)); } } }
for (AnnotatedMethod factory : _classDef.getStaticMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>();
for (AnnotatedMethod factory : _classDef.getStaticMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>();