/** * Returns {@link MethodDescriptor method descriptor} identified by name and parameters. */ public MethodDescriptor getMethodDescriptor(String name, boolean declared) { MethodDescriptor methodDescriptor = getMethods().getMethodDescriptor(name); if ((methodDescriptor != null) && methodDescriptor.matchDeclared(declared)) { return methodDescriptor; } return methodDescriptor; }
/** * Returns property descriptor. Declared flag is matched on both read and write * methods. */ public PropertyDescriptor getPropertyDescriptor(String name, boolean declared) { PropertyDescriptor propertyDescriptor = getProperties().getPropertyDescriptor(name); if ((propertyDescriptor != null) && propertyDescriptor.matchDeclared(declared)) { return propertyDescriptor; } return null; }
/** * Returns the constructor identified by arguments or <code>null</code> if not found. */ public CtorDescriptor getCtorDescriptor(Class[] args, boolean declared) { CtorDescriptor ctorDescriptor = getCtors().getCtorDescriptor(args); if ((ctorDescriptor != null) && ctorDescriptor.matchDeclared(declared)) { return ctorDescriptor; } return null; }
/** * Returns field descriptor. */ public FieldDescriptor getFieldDescriptor(String name, boolean declared) { FieldDescriptor fieldDescriptor = getFields().getFieldDescriptor(name); if (fieldDescriptor != null) { if (!fieldDescriptor.matchDeclared(declared)) { return null; } } return fieldDescriptor; }
/** * Returns the default ctor or <code>null</code> if not found. */ public CtorDescriptor getDefaultCtorDescriptor(boolean declared) { CtorDescriptor defaultCtor = getCtors().getDefaultCtor(); if ((defaultCtor != null) && defaultCtor.matchDeclared(declared)) { return defaultCtor; } return null; }
/** * Describes a class by creating a new instance of {@link ClassDescriptor} * that examines all accessible methods and fields. */ protected ClassDescriptor describeClass(Class type) { return new ClassDescriptor(type, scanAccessible, enhancedProperties, includeFieldsAsProperties, propertyFieldPrefix); }
/** * Returns an array of all methods. */ public MethodDescriptor[] getAllMethodDescriptors() { return getMethods().getAllMethodDescriptors(); }
/** * Returns all field descriptors, including declared ones. */ public FieldDescriptor[] getAllFieldDescriptors() { return getFields().getAllFieldDescriptors(); }
/** * Returns all properties descriptors. */ public PropertyDescriptor[] getAllPropertyDescriptors() { return getProperties().getAllPropertyDescriptors(); }
/** * Returns an array of all {@link CtorDescriptor constructor descriptors}. */ public CtorDescriptor[] getAllCtorDescriptors() { return getCtors().getAllCtorDescriptors(); }
/** * Returns constructors collection. * Creates new collection of first access. */ protected Ctors getCtors() { if (ctors == null) { ctors = new Ctors(this); } return ctors; }
/** * Returns <code>true</code> if class is a map. */ public boolean isMap() { return cd != null && cd.isMap(); }
/** * Returns methods collection. * Creates new collection on first access. */ protected Methods getMethods() { if (methods == null) { methods = new Methods(this); } return methods; }
/** * Returns properties collection. * Creates new collection on first access. */ protected Properties getProperties() { if (properties == null) { properties = new Properties(this); } return properties; }
/** * Creates new {@code FieldDescriptor}. */ protected FieldDescriptor createFieldDescriptor(Field field) { return new FieldDescriptor(classDescriptor, field); }
/** * Creates new {@link CtorDescriptor}. */ protected CtorDescriptor createCtorDescriptor(Constructor ctor) { return new CtorDescriptor(classDescriptor, ctor); }
/** * Clears all cached data. */ public static void reset() { JoddIntrospector.introspector.reset(); }
/** * Returns class descriptor for specified type. */ public static ClassDescriptor lookup(Class type) { return JoddIntrospector.introspector.lookup(type); }
/** * Returns {@link MethodDescriptor method descriptor} identified by name and parameters. */ public MethodDescriptor getMethodDescriptor(String name, Class[] params, boolean declared) { MethodDescriptor methodDescriptor = getMethods().getMethodDescriptor(name, params); if ((methodDescriptor != null) && methodDescriptor.matchDeclared(declared)) { return methodDescriptor; } return null; }
/** * Returns an array of all methods with the same name. */ public MethodDescriptor[] getAllMethodDescriptors(String name) { return getMethods().getAllMethodDescriptors(name); }