Example usage for java.lang Class toString

List of usage examples for java.lang Class toString

Introduction

In this page you can find the example usage for java.lang Class toString.

Prototype

public String toString() 

Source Link

Document

Converts the object to a string.

Usage

From source file:org.jboss.windup.reporting.transformers.MetaResultTransformResolver.java

public MetaResultTransformer<?> resolveTransformer(Class className) {
    return this.resolveTransformer(className.toString());
}

From source file:com.haulmont.cuba.core.sys.ClassLoaderManager.java

@Override
public String loadClass(String className) {
    try {/*from w ww  .  ja  v  a2s . c o  m*/
        Class<?> aClass = scripting.loadClassNN(className);
        return format("Loaded %s", aClass.toString());
    } catch (Exception e) {
        return ExceptionUtils.getStackTrace(e);
    }
}

From source file:com.haulmont.cuba.core.sys.javacl.ClassLoaderManager.java

@Override
public String loadClass(String className) {
    try {/*from  ww  w.  ja  va2  s  . c o  m*/
        Class<?> aClass = javaClassLoader.loadClass(className);
        return format("Loaded %s", aClass.toString());
    } catch (Exception e) {
        return ExceptionUtils.getStackTrace(e);
    }
}

From source file:org.apache.hadoop.hive.ql.exec.ExprNodeFuncEvaluator.java

public ExprNodeFuncEvaluator(exprNodeFuncDesc expr) {
    this.expr = expr;
    assert (expr != null);
    Class<?> c = expr.getUDFClass();
    udfMethod = expr.getUDFMethod();/*ww  w  .j  ava 2s. c om*/
    LOG.debug(c.toString());
    LOG.debug(udfMethod.toString());
    udf = (UDF) ReflectionUtils.newInstance(expr.getUDFClass(), null);
    int paramNumber = expr.getChildren().size();
    paramEvaluators = new ExprNodeEvaluator[paramNumber];
    paramInspectableObjects = new InspectableObject[paramNumber];
    for (int i = 0; i < paramNumber; i++) {
        paramEvaluators[i] = ExprNodeEvaluatorFactory.get(expr.getChildren().get(i));
        paramInspectableObjects[i] = new InspectableObject();
    }
    paramValues = new Object[expr.getChildren().size()];
    outputObjectInspector = ObjectInspectorFactory
            .getStandardPrimitiveObjectInspector(udfMethod.getReturnType());
}

From source file:org.apache.hadoop.hbase.thrift.ThriftMetrics.java

private void createMetricsForMethods(Class<?> iface) {
    LOG.debug("Creating metrics for interface " + iface.toString());
    for (Method m : iface.getDeclaredMethods()) {
        if (getMethodTimeMetrics(m.getName()) == null)
            LOG.debug("Creating metrics for method:" + m.getName());
        createMethodTimeMetrics(m.getName());
    }/*from w w w .  j  a va  2 s  .co m*/
}

From source file:com.kodokux.github.api.GithubApiUtil.java

@NotNull
private static <T> T fromJson(@Nullable JsonElement json, @NotNull Class<T> classT) throws IOException {
    if (json == null) {
        throw new GithubJsonException("Unexpected empty response");
    }//from   w w w  .j a v a2  s. c  o m

    T res;
    try {
        //cast as workaround for early java 1.6 bug
        //noinspection RedundantCast
        res = (T) gson.fromJson(json, classT);
    } catch (ClassCastException e) {
        throw new GithubJsonException("Parse exception while converting JSON to object " + classT.toString(),
                e);
    } catch (JsonParseException e) {
        throw new GithubJsonException("Parse exception while converting JSON to object " + classT.toString(),
                e);
    }
    if (res == null) {
        throw new GithubJsonException("Empty Json response");
    }
    return res;
}

From source file:org.eurekastreams.commons.search.bootstrap.EntityReindexer.java

/**
 * Reindex the entities set with the entitiesToReindex setter using the given entityManager.
 *///from w w w .jav a 2  s  .c  o  m
@SuppressWarnings("unchecked")
public void reindex() {
    // can't keep the full text session object across connections, so get it from the entity manager and pass it in
    FullTextSession search = getFullTextSession();
    log.info("reindex()");
    for (Class entityClass : entitiesToReindex) {
        log.info("Reindexing entity of type " + entityClass.toString());
        searchIndexManager.reindexEntities(entityClass, search);
        log.info("Done reindexing entity of type " + entityClass.toString());
    }
}

From source file:org.displaytag.render.SecurityService.java

public SecurityService(Class<?> cl) {
    recnumMethod = getRecnumMethod(cl);//from www  . jav a2s.  com
    if (log.isDebugEnabled()) {
        log.debug("creating security service for class:" + cl.toString());
        log.debug("recnumMethod = " + recnumMethod);
    }
}

From source file:org.eurekastreams.commons.search.bootstrap.SearchIndexManager.java

/**
 * Purge & index all entities with the input type, assuming the entity name is the same as the class name.
 *
 * @param entityClass/*from   w w w  .  j a v a 2s.  co  m*/
 *            the class of the entity to reindex into the search index
 * @param search
 *            the FullTextSession to use
 */
@SuppressWarnings("unchecked")
public void reindexEntities(final Class entityClass, final FullTextSession search) {
    log.info("reindexEntities(" + entityClass.toString() + ")");
    String entityName = entityClass.toString().substring(entityClass.toString().lastIndexOf('.') + 1);
    reindexEntities(entityClass, entityName, search);
}

From source file:org.aguntuk.xwidget.management.RequestProcessor.java

@SuppressWarnings({ "rawtypes", "unchecked" })
private Object populateBean(HttpServletRequest request, String requestClass) throws ClassNotFoundException,
        InstantiationException, IllegalAccessException, InvocationTargetException {
    Class reqClass = Class.forName(requestClass);
    Object bean = reqClass.newInstance();
    HashMap<String, Object> map = new HashMap<String, Object>();
    for (Enumeration<String> names = request.getParameterNames(); names.hasMoreElements();) {
        String name = names.nextElement();
        map.put(name, request.getParameterValues(name));
    }/*  w w  w.  j  ava 2  s  . c  o  m*/
    //scan the members for any nested class
    Field[] fields = reqClass.getDeclaredFields();
    for (Field f : fields) {
        Class classType = f.getType();
        String type = classType.toString();
        String memberName = f.getName();
        System.out.println(type + " " + memberName);
        if (type.indexOf("class") > -1) {
            if (!type.contains("java.lang")) {// we hit upon a nested object
                //recursive call
                Object nestedBean = populateBean(request, classType.getName());
                map.put(memberName, nestedBean);
            }
        }
    }

    BeanUtils.populate(bean, map);
    return bean;
}