Example usage for java.lang.reflect Modifier PUBLIC

List of usage examples for java.lang.reflect Modifier PUBLIC

Introduction

In this page you can find the example usage for java.lang.reflect Modifier PUBLIC.

Prototype

int PUBLIC

To view the source code for java.lang.reflect Modifier PUBLIC.

Click Source Link

Document

The int value representing the public modifier.

Usage

From source file:eu.annocultor.tools.GeneratorOfXmlSchemaForConvertersDoclet.java

static void printConstructorSchema(ConstructorDoc constr, PrintWriter out) throws Exception {
    if (constr.modifierSpecifier() == Modifier.PUBLIC) {
        String affix = constr.annotations()[0].elementValues()[1].value().toString();
        affix = StringUtils.stripEnd(StringUtils.stripStart(affix, "\""), "\"");

        out.println("<!-- " + constr.qualifiedName() + constr.signature() + " -->");
        out.println("       <xs:element name=\"" + constr.qualifiedName() + "-" + affix
                + "\" substitutionGroup=\"ABSTRACT-RULE\" >");
        out.println("        <xs:complexType> ");
        out.println("         <xs:sequence>");

        findType(constr, new Formatter(out) {

            @Override/*w w w.j  av a2  s  . c  om*/
            public void formatElementStart(String name, String type, boolean array) {
                writer.print("           <xs:element name=\"" + name + "\" type=\"" + type + "\""
                        + (array ? " minOccurs=\"0\" maxOccurs=\"unbounded\" " : "") + ">");
            }

            @Override
            public void formatDocumentation(String doc) {
                writer.print("\n         <xs:annotation><xs:documentation xml:lang=\"en\">"
                        + StringEscapeUtils.escapeXml(doc) + "</xs:documentation></xs:annotation>");
            }

            @Override
            public void formatElementEnd(String name) {
                writer.print(" \n            </xs:element>");
            }

        });
    }
    out.println(ruleListenerDef);
    out.println("      </xs:sequence>");
    out.println("     </xs:complexType> ");
    out.println("    </xs:element>");
}

From source file:org.eclipse.buildship.docs.source.SourceMetaDataVisitor.java

private int extractModifiers(GroovySourceAST ast) {
    GroovySourceAST modifiers = ast.childOfType(MODIFIERS);
    if (modifiers == null) {
        return 0;
    }//  w  w  w .j  av a 2  s.co m
    int modifierFlags = 0;
    for (GroovySourceAST child = (GroovySourceAST) modifiers
            .getFirstChild(); child != null; child = (GroovySourceAST) child.getNextSibling()) {
        switch (child.getType()) {
        case LITERAL_private:
            modifierFlags |= Modifier.PRIVATE;
            break;
        case LITERAL_protected:
            modifierFlags |= Modifier.PROTECTED;
            break;
        case LITERAL_public:
            modifierFlags |= Modifier.PUBLIC;
            break;
        case FINAL:
            modifierFlags |= Modifier.FINAL;
            break;
        case LITERAL_static:
            modifierFlags |= Modifier.STATIC;
            break;
        case ABSTRACT:
            modifierFlags |= Modifier.ABSTRACT;
            break;
        }
    }
    return modifierFlags;
}

From source file:org.gvnix.support.ItdBuilderHelper.java

/**
 * Prepares a field-setter method./*from  w  w w  .  j av  a  2 s  .c  o  m*/
 * <p/>
 * First, try to locate it on governor. Otherwise create it.
 * 
 * @param filedName
 * @param methodName
 * @param fieldType
 * @param aAnnotations (optional) annotation list
 * @return
 */
public MethodMetadata getSetterMethod(JavaSymbolName filedName, JavaSymbolName methodName, JavaType fieldType,
        List<AnnotationMetadataBuilder> aAnnotations) {
    // Define method parameter types
    List<AnnotatedJavaType> parameterTypes = new ArrayList<AnnotatedJavaType>();
    parameterTypes.add(new AnnotatedJavaType(fieldType));

    // Check if a method with the same signature already exists in the
    // target type
    final MethodMetadata method = methodExists(methodName, parameterTypes);
    if (method != null) {
        // If it already exists, just return the method and omit its
        // generation via the ITD
        return method;
    }

    // Define method annotations
    List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();
    if (aAnnotations != null) {
        annotations.addAll(aAnnotations);
    }

    // Define method throws types (none in this case)
    List<JavaType> throwsTypes = new ArrayList<JavaType>();

    // Define method parameter names
    List<JavaSymbolName> parameterNames = new ArrayList<JavaSymbolName>();
    parameterNames.add(filedName);

    // Create the method body
    InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
    buildSetterMethodBody(bodyBuilder, filedName);

    // Use the MethodMetadataBuilder for easy creation of MethodMetadata
    MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(metadata.getId(), Modifier.PUBLIC,
            methodName, JavaType.VOID_PRIMITIVE, parameterTypes, parameterNames, bodyBuilder);
    methodBuilder.setAnnotations(annotations);
    methodBuilder.setThrowsTypes(throwsTypes);

    return methodBuilder.build(); // Build and return a MethodMetadata
    // instance
}

From source file:org.gvnix.addon.jpa.addon.geo.providers.hibernatespatial.GvNIXEntityMapLayerMetadata.java

/**
 * Create a generic method to filter by all geometric fields from an entity
 * /*from   w ww  . ja va2 s.  c o m*/
 * @param entity
 * @param plural
 * @param geoFieldNames
 * @return
 */
private MethodMetadata getfindAllTheEntityByAllGeoms(JavaType entity, String plural,
        Map<JavaSymbolName, AnnotationAttributeValue<Integer>> geoFields) {
    // Define method parameter types
    List<AnnotatedJavaType> parameterTypes = new ArrayList<AnnotatedJavaType>();

    // Adding param types
    parameterTypes.add(AnnotatedJavaType
            .convertFromJavaType(new JavaType("org.gvnix.jpa.geo.hibernatespatial.util.GeometryFilter")));
    parameterTypes.add(AnnotatedJavaType.convertFromJavaType(
            new JavaType("java.lang.Class", 0, DataType.TYPE, null, Arrays.asList(new JavaType("T")))));
    parameterTypes.add(AnnotatedJavaType.convertFromJavaType(new JavaType(MAP.getFullyQualifiedTypeName(), 0,
            DataType.TYPE, null, Arrays.asList(JavaType.STRING, JavaType.OBJECT))));
    parameterTypes.add(AnnotatedJavaType.convertFromJavaType(
            new JavaType("java.lang.Iterable", 0, DataType.TYPE, null, Arrays.asList(JavaType.STRING))));
    parameterTypes.add(AnnotatedJavaType.convertFromJavaType(JavaType.STRING));

    // Getting method name
    JavaSymbolName methodName = new JavaSymbolName(String.format("findAll%sByGeoFilter", plural));

    // Check if a method with the same signature already exists in the
    // target type
    final MethodMetadata method = methodExists(methodName, parameterTypes);
    if (method != null) {
        // If it already exists, just return the method and omit its
        // generation via the ITD
        return method;
    }

    // Define method annotations
    List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();

    // Define method throws types
    List<JavaType> throwsTypes = new ArrayList<JavaType>();

    // Define method parameter names
    List<JavaSymbolName> parameterNames = new ArrayList<JavaSymbolName>();

    // Adding parameter names
    parameterNames.add(new JavaSymbolName("geomFilter"));
    parameterNames.add(new JavaSymbolName("klass"));
    parameterNames.add(new JavaSymbolName("hints"));
    parameterNames.add(new JavaSymbolName("fields"));
    parameterNames.add(new JavaSymbolName("scale"));

    // Create the method body
    InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
    buildfindAllTheEntityByAllGeomMethodBody(entity, plural, bodyBuilder, geoFields);

    // Return type: ResponseEntity<List<T>>
    JavaType responseEntityJavaType = new JavaType(new JavaType("java.util.List").getFullyQualifiedTypeName(),
            0, DataType.TYPE, null, Arrays.asList(new JavaType("T")));

    // Use the MethodMetadataBuilder for easy creation of MethodMetadata
    MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(getId(), Modifier.PUBLIC + Modifier.STATIC,
            methodName, responseEntityJavaType, parameterTypes, parameterNames, bodyBuilder);

    methodBuilder.setAnnotations(annotations);
    methodBuilder.setThrowsTypes(throwsTypes);
    methodBuilder.setGenericDefinition("T");

    return methodBuilder.build(); // Build and return a MethodMetadata
    // instance
}

From source file:com.ms.commons.test.tool.GenerateTestCase.java

private static MethodDeclaration makeEmptyTestMethodDeclaration(String methodName) {
    MethodDeclaration method = new MethodDeclaration();
    method.setModifiers(Modifier.PUBLIC);
    method.setName(methodName);/*from  w  ww  .j a v  a  2  s.  co  m*/
    method.setAnnotations(Arrays.asList((AnnotationExpr) new MarkerAnnotationExpr(makeNameExpr("Test"))));
    method.setType(new VoidType());

    List<Expression> testMethodArgs = Arrays.asList((Expression) new StringLiteralExpr("To be implement ..."));
    Statement statement = new ThrowStmt(
            new ObjectCreationExpr(null, new ClassOrInterfaceType("RuntimeException"), testMethodArgs));
    method.setBody(new BlockStmt(Arrays.asList(statement)));

    return method;
}

From source file:org.gvnix.addon.jpa.addon.query.JpaQueryMetadata.java

/**
 * Generate method to get the orderBy information
 * /*from  w  w  w  . jav  a 2s  . c  om*/
 * @param fieldsToProcess
 * @return
 */
private MethodMetadata getOrderByMethod(Map<FieldMetadata, AnnotationMetadata> fieldsToProcess) {

    // public Map<String,List<String>> getJpaQueryOrderBy() {

    // Check if a method with the same signature already exists in the
    // target type
    final MethodMetadata method = methodExists(GET_ORDERBY_DEFINITION, new ArrayList<AnnotatedJavaType>());
    if (method != null) {
        // If it already exists, just return the method and omit its
        // generation via the ITD
        return method;
    }

    // Define method annotations (none in this case)
    List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();

    // Define method throws types (none in this case)
    List<JavaType> throwsTypes = new ArrayList<JavaType>();

    // Define method parameter types (none in this case)
    List<AnnotatedJavaType> parameterTypes = new ArrayList<AnnotatedJavaType>();

    // Define method parameter names (none in this case)
    List<JavaSymbolName> parameterNames = new ArrayList<JavaSymbolName>();

    // Create the method body
    InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
    buildGetOrderByDefinitionMethodBody(bodyBuilder, fieldsToProcess);

    // Use the MethodMetadataBuilder for easy creation of MethodMetadata
    MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(getId(), Modifier.PUBLIC + Modifier.STATIC,
            GET_ORDERBY_DEFINITION, MAP_STRING_LIST_STRING, parameterTypes, parameterNames, bodyBuilder);
    methodBuilder.setAnnotations(annotations);
    methodBuilder.setThrowsTypes(throwsTypes);

    return methodBuilder.build(); // Build and return a MethodMetadata
                                  // instance
}

From source file:org.gvnix.addon.loupefield.addon.LoupefieldMetadata.java

/**
 * Gets <code>findUsingAjax</code> method. <br>
 * //  ww  w  .  j ava2s. c o m
 * @param entity
 * @return
 */
private MethodMetadata getFindUsingAjaxMethod(JavaType entity) {
    // Define method parameter types
    List<AnnotatedJavaType> parameterTypes = AnnotatedJavaType
            .convertFromJavaTypes(new JavaType("org.springframework.web.context.request.WebRequest"));

    // Adding search param
    AnnotationMetadataBuilder searchMetadataBuilder = new AnnotationMetadataBuilder(
            SpringJavaType.REQUEST_PARAM);
    searchMetadataBuilder.addStringAttribute(VALUE_LABEL, "_search_");
    searchMetadataBuilder.addBooleanAttribute(REQUIRED_LABEL, false);

    // Adding id param
    AnnotationMetadataBuilder idMetadataBuilder = new AnnotationMetadataBuilder(SpringJavaType.REQUEST_PARAM);
    idMetadataBuilder.addStringAttribute(VALUE_LABEL, "_id_");
    idMetadataBuilder.addBooleanAttribute(REQUIRED_LABEL, false);

    // Adding pkField param
    AnnotationMetadataBuilder pkFieldMetadataBuilder = new AnnotationMetadataBuilder(
            SpringJavaType.REQUEST_PARAM);
    pkFieldMetadataBuilder.addStringAttribute(VALUE_LABEL, "_pkField_");

    // Adding max param
    AnnotationMetadataBuilder maxMetadataBuilder = new AnnotationMetadataBuilder(SpringJavaType.REQUEST_PARAM);
    maxMetadataBuilder.addStringAttribute(VALUE_LABEL, "_max_");
    maxMetadataBuilder.addBooleanAttribute(REQUIRED_LABEL, false);
    maxMetadataBuilder.addStringAttribute("defaultValue", "3");

    // Adding caption param
    AnnotationMetadataBuilder captionMetadataBuilder = new AnnotationMetadataBuilder(
            SpringJavaType.REQUEST_PARAM);
    captionMetadataBuilder.addStringAttribute(VALUE_LABEL, "_caption_");
    captionMetadataBuilder.addBooleanAttribute(REQUIRED_LABEL, false);

    // Adding additionalFields param
    AnnotationMetadataBuilder additionalFieldsMB = new AnnotationMetadataBuilder(SpringJavaType.REQUEST_PARAM);
    additionalFieldsMB.addStringAttribute(VALUE_LABEL, "_additionalFields_");
    additionalFieldsMB.addBooleanAttribute(REQUIRED_LABEL, false);

    // Adding field param
    AnnotationMetadataBuilder fieldMetadataBuilder = new AnnotationMetadataBuilder(
            SpringJavaType.REQUEST_PARAM);
    fieldMetadataBuilder.addStringAttribute(VALUE_LABEL, "_field_");

    parameterTypes.add(new AnnotatedJavaType(JavaType.STRING, searchMetadataBuilder.build()));
    parameterTypes.add(new AnnotatedJavaType(JavaType.STRING, idMetadataBuilder.build()));
    parameterTypes.add(new AnnotatedJavaType(JavaType.STRING, pkFieldMetadataBuilder.build()));
    parameterTypes.add(new AnnotatedJavaType(JavaType.INT_OBJECT, maxMetadataBuilder.build()));
    parameterTypes.add(new AnnotatedJavaType(JavaType.STRING, captionMetadataBuilder.build()));
    parameterTypes.add(new AnnotatedJavaType(JavaType.STRING, additionalFieldsMB.build()));
    parameterTypes.add(new AnnotatedJavaType(JavaType.STRING, fieldMetadataBuilder.build()));

    // Check if a method with the same signature already exists in the
    // target type
    final MethodMetadata method = methodExists(FIND_USING_AJAX_METHOD_NAME, parameterTypes);
    if (method != null) {
        // If it already exists, just return the method and omit its
        // generation via the ITD
        return method;
    }

    // Define method annotations
    List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();

    AnnotationMetadataBuilder requestMappingMetadataBuilder = new AnnotationMetadataBuilder(
            SpringJavaType.REQUEST_MAPPING);

    requestMappingMetadataBuilder.addStringAttribute("params", "findUsingAjax");
    requestMappingMetadataBuilder.addStringAttribute("headers", "Accept=application/json");

    annotations.add(requestMappingMetadataBuilder);
    annotations.add(new AnnotationMetadataBuilder(SpringJavaType.RESPONSE_BODY));

    // Define method throws types
    List<JavaType> throwsTypes = new ArrayList<JavaType>();

    // Define method parameter names
    List<JavaSymbolName> parameterNames = new ArrayList<JavaSymbolName>();
    parameterNames.add(new JavaSymbolName("request"));
    parameterNames.add(new JavaSymbolName("search"));
    parameterNames.add(new JavaSymbolName("id"));
    parameterNames.add(new JavaSymbolName("pkField"));
    parameterNames.add(new JavaSymbolName("maxResult"));
    parameterNames.add(new JavaSymbolName("caption"));
    parameterNames.add(new JavaSymbolName("additionalFields"));
    parameterNames.add(new JavaSymbolName("field"));

    // Create the method body
    InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();

    buildFindUsingAjaxMethodBody(bodyBuilder, entity);

    // Use the MethodMetadataBuilder for easy creation of MethodMetadata
    MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(getId(), Modifier.PUBLIC,
            FIND_USING_AJAX_METHOD_NAME, RESPONSE_ENTITY, parameterTypes, parameterNames, bodyBuilder);
    methodBuilder.setAnnotations(annotations);
    methodBuilder.setThrowsTypes(throwsTypes);

    return methodBuilder.build(); // Build and return a MethodMetadata
    // instance
}

From source file:org.disciple.db.Abatis.java

/**
 * JsonString//from  w  ww . j  ava2 s  .  c  o  m
 *  
 * @param jsonStr JSON String
 * @param beanClass Bean class 
 * @param basePackage Base package name which includes all Bean classes 
 * @return Object Bean
 * @throws Exception
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
private Object parse(String jsonStr, Class beanClass, String basePackage) throws Exception {
    Object obj = null;
    JSONObject jsonObj = new JSONObject(jsonStr);
    // Check bean object
    if (beanClass == null) {
        Log.d(TAG, "Bean class is null");
        return null;
    }
    // Read Class member fields
    Field[] props = beanClass.getDeclaredFields();
    if (props == null || props.length == 0) {
        Log.d(TAG, "Class" + beanClass.getName() + " has no fields");
        return null;
    }
    // Create instance of this Bean class
    obj = beanClass.newInstance();
    // Set value of each member variable of this object
    for (int i = 0; i < props.length; i++) {
        String fieldName = props[i].getName();
        // Skip public and static fields
        if (props[i].getModifiers() == (Modifier.PUBLIC | Modifier.STATIC)) {
            continue;
        }
        // Date Type of Field 
        Class type = props[i].getType();
        String typeName = type.getName();
        // Check for Custom type
        if (typeName.equals("int")) {
            Class[] parms = { type };
            Method m = beanClass.getDeclaredMethod(getBeanMethodName(fieldName, 1), parms);
            m.setAccessible(true);
            // Set value
            try {
                m.invoke(obj, jsonObj.getInt(fieldName));
            } catch (Exception ex) {
                Log.d(TAG, ex.getMessage());
            }
        } else if (typeName.equals("long")) {
            Class[] parms = { type };
            Method m = beanClass.getDeclaredMethod(getBeanMethodName(fieldName, 1), parms);
            m.setAccessible(true);
            // Set value
            try {
                m.invoke(obj, jsonObj.getLong(fieldName));
            } catch (Exception ex) {
                Log.d(TAG, ex.getMessage());
            }
        } else if (typeName.equals("java.lang.String")) {
            Class[] parms = { type };
            Method m = beanClass.getDeclaredMethod(getBeanMethodName(fieldName, 1), parms);
            m.setAccessible(true);
            // Set value
            try {
                m.invoke(obj, jsonObj.getString(fieldName));
            } catch (Exception ex) {
                Log.d(TAG, ex.getMessage());
            }
        } else if (typeName.equals("double")) {
            Class[] parms = { type };
            Method m = beanClass.getDeclaredMethod(getBeanMethodName(fieldName, 1), parms);
            m.setAccessible(true);
            // Set value
            try {
                m.invoke(obj, jsonObj.getDouble(fieldName));
            } catch (Exception ex) {
                Log.d(TAG, ex.getMessage());
            }
        } else if (type.getName().equals(List.class.getName())
                || type.getName().equals(ArrayList.class.getName())) {
            // Find out the Generic
            String generic = props[i].getGenericType().toString();
            if (generic.indexOf("<") != -1) {
                String genericType = generic.substring(generic.lastIndexOf("<") + 1, generic.lastIndexOf(">"));
                if (genericType != null) {
                    JSONArray array = null;
                    try {
                        array = jsonObj.getJSONArray(fieldName);
                    } catch (Exception ex) {
                        Log.d(TAG, ex.getMessage());
                        array = null;
                    }
                    if (array == null) {
                        continue;
                    }
                    ArrayList arrayList = new ArrayList();
                    for (int j = 0; j < array.length(); j++) {
                        arrayList.add(parse(array.getJSONObject(j).toString(), Class.forName(genericType),
                                basePackage));
                    }
                    // Set value
                    Class[] parms = { type };
                    Method m = beanClass.getDeclaredMethod(getBeanMethodName(fieldName, 1), parms);
                    m.setAccessible(true);
                    m.invoke(obj, arrayList);
                }
            } else {
                // No generic defined
                generic = null;
            }
        } else if (typeName.startsWith(basePackage)) {
            Class[] parms = { type };
            Method m = beanClass.getDeclaredMethod(getBeanMethodName(fieldName, 1), parms);
            m.setAccessible(true);
            // Set value
            try {
                JSONObject customObj = jsonObj.getJSONObject(fieldName);
                if (customObj != null) {
                    m.invoke(obj, parse(customObj.toString(), type, basePackage));
                }
            } catch (JSONException ex) {
                Log.d(TAG, ex.getMessage());
            }
        } else {
            // Skip
            Log.d(TAG, "Field " + fieldName + "#" + typeName + " is skip");
        }
    }
    return obj;
}

From source file:com.adaptc.mws.plugins.testing.transformations.TestMixinTransformation.java

/**
 * Adds a delegate method to the target class node where the first argument
 * is to the delegate method is 'this'. In other words a method such as
 * foo(Object instance, String bar) would be added with a signature of foo(String)
 * and 'this' is passed to the delegate instance
 *
 * @param classNode The class node//from ww  w  .jav a  2s. com
 * @param delegate The expression that looks up the delegate
 * @param declaredMethod The declared method
 * @param thisAsFirstArgument Whether 'this' should be passed as the first argument to the method
 * @return The added method node or null if it couldn't be added
 */
public static MethodNode addDelegateInstanceMethod(ClassNode classNode, Expression delegate,
        MethodNode declaredMethod, boolean thisAsFirstArgument) {
    Parameter[] parameterTypes = thisAsFirstArgument
            ? getRemainingParameterTypes(declaredMethod.getParameters())
            : declaredMethod.getParameters();
    String methodName = declaredMethod.getName();
    if (classNode.hasDeclaredMethod(methodName, parameterTypes)) {
        return null;
    }
    String propertyName = getPropertyForGetter(methodName);
    if (propertyName != null && parameterTypes.length == 0 && classNode.hasProperty(propertyName)) {
        return null;
    }
    propertyName = getPropertyForSetter(methodName);
    if (propertyName != null && parameterTypes.length == 1 && classNode.hasProperty(propertyName)) {
        return null;
    }

    BlockStatement methodBody = new BlockStatement();
    ArgumentListExpression arguments = createArgumentListFromParameters(parameterTypes, thisAsFirstArgument);

    ClassNode returnType = nonGeneric(declaredMethod.getReturnType());

    MethodCallExpression methodCallExpression = new MethodCallExpression(delegate, methodName, arguments);
    methodCallExpression.setMethodTarget(declaredMethod);
    ThrowStatement missingMethodException = createMissingMethodThrowable(classNode, declaredMethod);
    VariableExpression apiVar = addApiVariableDeclaration(delegate, declaredMethod, methodBody);
    IfStatement ifStatement = createIfElseStatementForApiMethodCall(methodCallExpression, apiVar,
            missingMethodException);

    methodBody.addStatement(ifStatement);
    MethodNode methodNode = new MethodNode(methodName, Modifier.PUBLIC, returnType,
            copyParameters(parameterTypes), EMPTY_CLASS_ARRAY, methodBody);
    methodNode.addAnnotations(declaredMethod.getAnnotations());

    classNode.addMethod(methodNode);
    return methodNode;
}

From source file:de.micromata.tpsb.doc.TpsbEnvUtils.java

public static boolean isAvailableForTpsbConsole(MethodInfo mi) {
    if (getAnnotation(mi, TpsbIgnore.class.getSimpleName()) != null) {
        return false;
    }/*from   www  . j a va2 s .com*/
    if ((mi.getModifier() & Modifier.PUBLIC) != Modifier.PUBLIC) {
        return false;
    }
    if ((mi.getModifier() & Modifier.STATIC) == Modifier.STATIC) {
        return false;
    }
    return true;
}