Example usage for java.lang NoSuchMethodException getMessage

List of usage examples for java.lang NoSuchMethodException getMessage

Introduction

In this page you can find the example usage for java.lang NoSuchMethodException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.jaffa.soa.dataaccess.TransformerUtils.java

/**
 * Take a source object and try and mold it back it its domain object.
 * This is the same as updateParent, except from the way it retrieved the
 * record, and the way it creates a new record.
 *//*from ww  w  .j a  v a 2s  .co m*/
static void deleteChildBean(String path, GraphDataObject source, UOW uow, ITransformationHandler handler,
        IPersistent parentDomain, GraphMapping parentMapping, String parentField)
        throws ApplicationExceptions, FrameworkException {
    if (log.isDebugEnabled())
        log.debug("Delete Child Bean " + path);
    String relationshipName = parentMapping.getDomainFieldName(parentField);
    if (relationshipName.endsWith("Array"))
        relationshipName = relationshipName.substring(0, relationshipName.length() - 5);
    if (relationshipName.endsWith("Object"))
        relationshipName = relationshipName.substring(0, relationshipName.length() - 6);

    try {

        IPersistent domainObject = null;
        GraphMapping mapping = MappingFactory.getInstance(source);
        Map keys = new LinkedHashMap();
        Class doClass = mapping.getDomainClass();
        boolean gotKeys = false;

        // The path for a one-to-many relationship ends with a "[i]". The absence of that suffix indicates a one-to-one relationship
        //// No keys, must be one-to-one
        //if (mapping.getKeyFields() == null || mapping.getKeyFields().size() == 0) {
        if (path == null || path.charAt(path.length() - 1) != ']') {
            if (log.isDebugEnabled())
                log.debug("Find 'one-to-one' object - " + path);

            // Just use the getXxxObject method to get the related domain object,
            // if there is one...
            domainObject = (IPersistent) getProperty(parentMapping.getDomainFieldDescriptor(parentField),
                    parentDomain);
            if (domainObject == null) {
                if (log.isDebugEnabled())
                    log.debug("Not Found - " + path);
            }
        } else {
            // Get the key fields used in the domain object. Use the findXxxxxCriteria() method,
            // then add the extra fields to the criteria object, to get the unique record.
            gotKeys = fillInKeys(path, source, mapping, keys);

            // read DO based on key
            if (gotKeys) {
                // get the method to get the PK criteria (i.e. public Criteria findVendorSiteCriteria(); )
                Method findCriteria = null;
                String methodName = "find" + StringHelper.getUpper1(relationshipName) + "Criteria";
                try {
                    findCriteria = parentDomain.getClass().getMethod(methodName, new Class[] {});
                } catch (NoSuchMethodException e) {
                    log.error("Find method '" + methodName + "' not found!");
                }
                if (findCriteria == null)
                    throw new TransformException(TransformException.METHOD_NOT_FOUND, path, methodName);

                // Find Criteria For Related Object
                Criteria criteria = (Criteria) findCriteria.invoke(parentDomain, new Object[] {});
                // Add extra key info...
                for (Iterator it = keys.keySet().iterator(); it.hasNext();) {
                    String keyField = (String) it.next();
                    Object value = keys.get(keyField);
                    keyField = StringHelper.getUpper1(mapping.getDomainFieldName(keyField));
                    criteria.addCriteria(keyField, value);
                    if (log.isDebugEnabled())
                        log.debug(path + "- Add to criteria:" + keyField + '=' + value);
                }
                // See if we get an object :-)
                Iterator itr = uow.query(criteria).iterator();
                if (itr.hasNext())
                    domainObject = (IPersistent) itr.next();
                if (itr.hasNext()) {
                    // Error, multiple objects found
                    throw new ApplicationExceptions(new ApplicationExceptionWithContext(path,
                            new MultipleDomainObjectsFoundException(findDomainLabel(criteria.getTable()))));
                }
            }

        }
        // Error if DO not found
        if (domainObject == null)
            throw new ApplicationExceptions(new ApplicationExceptionWithContext(path,
                    new DomainObjectNotFoundException(findDomainLabel(doClass))));

        // Process the delete, either on this DO, or a related DO if there is one
        deleteBeanData(path, source, uow, handler, mapping, domainObject);

    } catch (IllegalAccessException e) {
        TransformException me = new TransformException(TransformException.ACCESS_ERROR, path, e.getMessage());
        log.error(me.getLocalizedMessage(), e);
        throw me;
    } catch (InvocationTargetException e) {
        ApplicationExceptions appExps = ExceptionHelper.extractApplicationExceptions(e);
        if (appExps != null)
            throw appExps;
        FrameworkException fe = ExceptionHelper.extractFrameworkException(e);
        if (fe != null)
            throw fe;
        TransformException me = new TransformException(TransformException.INVOCATION_ERROR, path, e);
        log.error(me.getLocalizedMessage(), me.getCause());
        throw me;
    } catch (InstantiationException e) {
        TransformException me = new TransformException(TransformException.INSTANTICATION_ERROR, path,
                e.getMessage());
        log.error(me.getLocalizedMessage(), e);
        throw me;
    }
}

From source file:com.mantz_it.rfanalyzer.ui.activity.MainActivity.java

/**
 * Reflection-based source settings updater
 *
 * @param clazz desired class of source//from ww w .j  av a 2 s . c o m
 * @return current source with updated settings, or new source if current source type isn't instance of desired source.
 */
protected void updateSourcePreferences(final Class<?> clazz) {
    // if src is of desired class -- just update
    if (clazz.isInstance(this.source)) {
        setSource(this.source.updatePreferences(this, preferences));
        analyzerSurface.setSource(this.source);
    } else {
        // create new
        this.source.close();
        final String msg;
        try {
            // we can't force sources to implement constructor with needed parameters,
            // to drop need of tracking all sources that could be added later just use reflection
            // to call constructor with current Context and SharedPreferences and let source configure itself
            Constructor ctor = clazz.getDeclaredConstructor(Context.class, SharedPreferences.class);
            ctor.setAccessible(true);
            setSource((IQSource) ctor.newInstance(this, preferences));
            analyzerSurface.setSource(this.source);
            return;
        } catch (NoSuchMethodException e) {
            Log.e(LOGTAG, "updateSourcePreferences: "
                    + (msg = "selected source doesn't have constructor with demanded parameters (Context, SharedPreferences)"));
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            Log.e(LOGTAG, "updateSourcePreferences: "
                    + (msg = "selected source doesn't have accessible constructor with demanded parameters (Context, SharedPreferences)"));
            e.printStackTrace();
        } catch (InstantiationException e) {
            Log.e(LOGTAG, "updateSourcePreferences: "
                    + (msg = "selected source doesn't have accessible for MainActivity constructor with demanded parameters (Context, SharedPreferences)"));
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            Log.e(LOGTAG, "updateSourcePreferences: "
                    + (msg = "source's constructor thrown exception: " + e.getMessage()));
            e.printStackTrace();
        }
        stopAnalyzer();
        this.runOnUiThread(
                () -> toaster.showLong("Error with instantiating source [" + clazz.getName() + "]: "));
        setSource(null);
    }
}

From source file:org.sikuli.ide.SikuliIDE.java

private void initMenuBars(JFrame frame) {
    try {/*w w w .  j a v a  2  s.  co m*/
        initFileMenu();
        initEditMenu();
        initRunMenu();
        initViewMenu();
        initToolMenu();
        initHelpMenu();
    } catch (NoSuchMethodException e) {
        log(-1, "Problem when initializing menues\nError: %s", e.getMessage());
    }

    _menuBar.add(_fileMenu);
    _menuBar.add(_editMenu);
    _menuBar.add(_runMenu);
    _menuBar.add(_viewMenu);
    _menuBar.add(_toolMenu);
    _menuBar.add(_helpMenu);
    frame.setJMenuBar(_menuBar);
}

From source file:org.apache.hadoop.hive.metastore.HiveMetaStoreClient.java

private MetaStoreFilterHook loadFilterHooks() throws IllegalStateException {
    Class<? extends MetaStoreFilterHook> authProviderClass = conf.getClass(
            HiveConf.ConfVars.METASTORE_FILTER_HOOK.varname, DefaultMetaStoreFilterHookImpl.class,
            MetaStoreFilterHook.class);
    String msg = "Unable to create instance of " + authProviderClass.getName() + ": ";
    try {//w  w  w . ja v a  2s .c o m
        Constructor<? extends MetaStoreFilterHook> constructor = authProviderClass
                .getConstructor(HiveConf.class);
        return constructor.newInstance(conf);
    } catch (NoSuchMethodException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    } catch (SecurityException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    } catch (InstantiationException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    } catch (IllegalAccessException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    } catch (IllegalArgumentException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    } catch (InvocationTargetException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    }
}

From source file:nonjsp.application.BuildComponentFromTagImpl.java

public void applyAttributesToComponentInstance(UIComponent child, Attributes attrs) {
    int attrLen, i = 0;
    String attrName, attrValue;/*from   w w w.ja va2  s . co m*/

    attrLen = attrs.getLength();
    for (i = 0; i < attrLen; i++) {
        attrName = mapAttrNameToPropertyName(attrs.getLocalName(i));
        attrValue = attrs.getValue(i);

        // First, try to set it as a bean property
        try {
            PropertyUtils.setNestedProperty(child, attrName, attrValue);
        } catch (NoSuchMethodException e) {
            // If that doesn't work, see if it requires special
            // treatment
            try {
                if (attrRequiresSpecialTreatment(attrName)) {
                    handleSpecialAttr(child, attrName, attrValue);
                } else {
                    // If that doesn't work, this will.
                    child.getAttributes().put(attrName, attrValue);
                }
            } catch (IllegalAccessException innerE) {
                innerE.printStackTrace();
                log.trace(innerE.getMessage());
            } catch (IllegalArgumentException innerE) {
                innerE.printStackTrace();
                log.trace(innerE.getMessage());
            } catch (InvocationTargetException innerE) {
                innerE.printStackTrace();
                log.trace(innerE.getMessage());
            } catch (NoSuchMethodException innerE) {
                innerE.printStackTrace();
                log.trace(innerE.getMessage());
            }
        } catch (IllegalArgumentException e) {
            try {
                if (attrRequiresSpecialTreatment(attrName)) {
                    handleSpecialAttr(child, attrName, attrValue);
                } else {
                    // If that doesn't work, this will.
                    child.getAttributes().put(attrName, attrValue);
                }
            } catch (IllegalAccessException innerE) {
                innerE.printStackTrace();
                log.trace(innerE.getMessage());
            } catch (IllegalArgumentException innerE) {
                innerE.printStackTrace();
                log.trace(innerE.getMessage());
            } catch (InvocationTargetException innerE) {
                innerE.printStackTrace();
                log.trace(innerE.getMessage());
            } catch (NoSuchMethodException innerE) {
                innerE.printStackTrace();
                log.trace(innerE.getMessage());
            }
        } catch (InvocationTargetException e) {
            e.printStackTrace();
            log.trace(e.getMessage());
        } catch (IllegalAccessException e) {
            e.printStackTrace();
            log.trace(e.getMessage());
        }
    }

    // cleanup: make sure we have the necessary required attributes
    if (child.getId() == null) {
        String gId = "foo" + Util.generateId();
        child.setId(gId);
    }

}

From source file:com.alibaba.dubbo.governance.web.common.module.screen.Restful.java

public void execute(Map<String, Object> context) throws Throwable {
    if (context.get(WebConstants.CURRENT_USER_KEY) != null) {
        User user = (User) context.get(WebConstants.CURRENT_USER_KEY);
        currentUser = user;/*from   ww w .j ava 2s  . com*/
        operator = user.getUsername();
        role = user.getRole();
        context.put(WebConstants.CURRENT_USER_KEY, user);
    }
    operatorAddress = (String) context.get("request.remoteHost");
    context.put("operator", operator);
    context.put("operatorAddress", operatorAddress);

    context.put("currentRegistry", currentRegistry);

    String httpMethod = (String) context.get("request.method");
    String method = (String) context.get("_method");
    String contextPath = (String) context.get("request.contextPath");
    context.put("rootContextPath", new RootContextPath(contextPath));

    // ?Method
    if (method == null || method.length() == 0) {
        String id = (String) context.get("id");
        if (id == null || id.length() == 0) {
            method = "index";
        } else {
            method = "show";
        }
    }
    if ("index".equals(method)) {
        if ("post".equalsIgnoreCase(httpMethod)) {
            method = "create";
        }
    } else if ("show".equals(method)) {
        if ("put".equalsIgnoreCase(httpMethod) || "post".equalsIgnoreCase(httpMethod)) { // ????PUTPOST
            method = "update";
        } else if ("delete".equalsIgnoreCase(httpMethod)) { // ????DELETE?
            method = "delete";
        }
    }
    context.put("_method", method);

    try {
        Method m = null;
        try {
            m = getClass().getMethod(method, new Class<?>[] { Map.class });
        } catch (NoSuchMethodException e) {
            for (Method mtd : getClass().getMethods()) {
                if (Modifier.isPublic(mtd.getModifiers()) && mtd.getName().equals(method)) {
                    m = mtd;
                    break;
                }
            }
            if (m == null) {
                throw e;
            }
        }
        if (m.getParameterTypes().length > 2) {
            throw new IllegalStateException("Unsupport restful method " + m);
        } else if (m.getParameterTypes().length == 2 && (m.getParameterTypes()[0].equals(Map.class)
                || !m.getParameterTypes()[1].equals(Map.class))) {
            throw new IllegalStateException("Unsupport restful method " + m);
        }
        Object r;
        if (m.getParameterTypes().length == 0) {
            r = m.invoke(this, new Object[0]);
        } else {
            Object value;
            Class<?> t = m.getParameterTypes()[0];
            if (Map.class.equals(t)) {
                value = context;
            } else if (isPrimitive(t)) {
                String id = (String) context.get("id");
                value = convertPrimitive(t, id);
            } else if (t.isArray() && isPrimitive(t.getComponentType())) {
                String id = (String) context.get("id");
                String[] ids = id == null ? new String[0] : id.split("[.+]+");
                value = Array.newInstance(t.getComponentType(), ids.length);
                for (int i = 0; i < ids.length; i++) {
                    Array.set(value, i, convertPrimitive(t.getComponentType(), ids[i]));
                }
            } else {
                value = t.newInstance();
                for (Method mtd : t.getMethods()) {
                    if (Modifier.isPublic(mtd.getModifiers()) && mtd.getName().startsWith("set")
                            && mtd.getParameterTypes().length == 1) {
                        String p = mtd.getName().substring(3, 4).toLowerCase() + mtd.getName().substring(4);
                        Object v = context.get(p);
                        if (v == null) {
                            if ("operator".equals(p)) {
                                v = operator;
                            } else if ("operatorAddress".equals(p)) {
                                v = (String) context.get("request.remoteHost");
                            }
                        }
                        if (v != null) {
                            try {
                                mtd.invoke(value, new Object[] { CompatibleTypeUtils.compatibleTypeConvert(v,
                                        mtd.getParameterTypes()[0]) });
                            } catch (Throwable e) {
                                logger.warn(e.getMessage(), e);
                            }
                        }
                    }
                }
            }
            if (m.getParameterTypes().length == 1) {
                r = m.invoke(this, new Object[] { value });
            } else {
                r = m.invoke(this, new Object[] { value, context });
            }
        }
        if (m.getReturnType() == boolean.class || m.getReturnType() == Boolean.class) {
            context.put("rundata.layout", "redirect");
            context.put("rundata.target", "redirect");
            context.put("success", r == null || ((Boolean) r).booleanValue());
            if (context.get("redirect") == null) {
                context.put("redirect", getDefaultRedirect(context, method));
            }
        } else if (m.getReturnType() == String.class) {
            String redirect = (String) r;
            if (redirect == null) {
                redirect = getDefaultRedirect(context, method);
            }

            if (context.get("chain") != null) {
                context.put("rundata.layout", "home");
                context.put("rundata.target", "home");
            } else {
                context.put("rundata.redirect", redirect);
            }
        } else {
            context.put("rundata.layout", method);
            context.put("rundata.target", context.get("rundata.target") + "/" + method);
        }
    } catch (Throwable e) {
        if (e instanceof InvocationTargetException) {
            throw ((InvocationTargetException) e).getTargetException();
        }
        //            if (e instanceof InvocationTargetException) {
        //                e = ((InvocationTargetException) e).getTargetException();
        //            }
        //            logger.warn(e.getMessage(), e);
        //            context.put("rundata.layout", "redirect");
        //            context.put("rundata.target", "redirect");
        //            context.put("success", false);
        //            context.put("exception", e);
        //            context.put("redirect", getDefaultRedirect(context, method));
    }
}

From source file:org.modeldriven.fuml.assembly.ElementAssembler.java

public void associateElement(ElementAssembler other) {
    try {//ww w  .j  a v  a 2  s  .  c o  m
        Property property = other.getPrototype().findProperty(this.getSource().getLocalName());
        if (property == null)
            return; // we validate this elsewhere

        if (!property.isSingular()) {
            if (log.isDebugEnabled())
                log.debug("linking collection property: " + other.getPrototype().getName() + "."
                        + this.getSource().getLocalName() + " with: " + this.getPrototype().getName());
            try {
                String methodName = "add" + this.getSource().getLocalName().substring(0, 1).toUpperCase()
                        + this.getSource().getLocalName().substring(1);
                Method adder = ReflectionUtils.getMethod(other.getTargetClass(), methodName,
                        this.getTargetClass());
                Object[] args = { this.getTargetObject() };
                adder.invoke(other.getTarget(), args);
            } catch (NoSuchMethodException e) {
                // try to get and add to the list field if exists
                try {
                    Field field = other.getTargetClass().getField(this.getSource().getLocalName());
                    Object list = field.get(other.getTargetObject());
                    Method adder = ReflectionUtils.getMethod(list.getClass(), "add", this.getTargetClass());
                    Object[] args = { this.getTargetObject() };
                    adder.invoke(list, args);
                } catch (NoSuchFieldException e2) {
                    log.warn("no 'add' or 'List.add' method found for property, "
                            + other.getPrototype().getName() + "." + this.getSource().getLocalName());
                }
            }
        } else {
            if (log.isDebugEnabled())
                log.debug("linking singular property: " + other.getPrototype().getName() + "."
                        + this.getSource().getLocalName() + " with: " + this.getPrototype().getName());
            try {
                String methodName = "set" + this.getSource().getLocalName().substring(0, 1).toUpperCase()
                        + this.getSource().getLocalName().substring(1);
                Method setter = ReflectionUtils.getMethod(other.getTargetClass(), methodName,
                        this.getTargetClass());
                Object[] args = { this.getTargetObject() };
                setter.invoke(other.getTarget(), args);
            } catch (NoSuchMethodException e) {
                // try to get and add to the list field if exists
                try {
                    Field field = other.getTargetClass().getField(this.getSource().getLocalName());
                    field.set(other.getTargetObject(), this.getTargetObject());
                } catch (NoSuchFieldException e2) {
                    log.warn("no 'set' method or public field found for property, "
                            + other.getPrototype().getName() + "." + this.getSource().getLocalName());
                }
            }
        }
    } catch (NoSuchMethodException e) {
        log.error(e.getMessage(), e);
        throw new AssemblyException(e);
    } catch (InvocationTargetException e) {
        log.error(e.getCause().getMessage(), e.getCause());
        throw new AssemblyException(e.getCause());
    } catch (IllegalAccessException e) {
        log.error(e.getMessage(), e);
        throw new AssemblyException(e);
    }
}

From source file:org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.java

private HiveAuthorizationTaskFactory createAuthorizationTaskFactory(HiveConf conf, Hive db) {
    Class<? extends HiveAuthorizationTaskFactory> authProviderClass = conf.getClass(
            HiveConf.ConfVars.HIVE_AUTHORIZATION_TASK_FACTORY.varname, HiveAuthorizationTaskFactoryImpl.class,
            HiveAuthorizationTaskFactory.class);
    String msg = "Unable to create instance of " + authProviderClass.getName() + ": ";
    try {//from   ww  w  .j a va  2 s.  com
        Constructor<? extends HiveAuthorizationTaskFactory> constructor = authProviderClass
                .getConstructor(HiveConf.class, Hive.class);
        return constructor.newInstance(conf, db);
    } catch (NoSuchMethodException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    } catch (SecurityException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    } catch (InstantiationException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    } catch (IllegalAccessException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    } catch (IllegalArgumentException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    } catch (InvocationTargetException e) {
        throw new IllegalStateException(msg + e.getMessage(), e);
    }
}

From source file:org.quartz.impl.jdbcjobstore.JobStoreSupport.java

/**
 * <P>/*from w  ww .ja  va2 s  . com*/
 * Get the driver delegate for DB operations.
 * </p>
 */
protected DriverDelegate getDelegate() throws NoSuchDelegateException {
    if (null == delegate) {
        try {
            if (delegateClassName != null) {
                delegateClass = getClassLoadHelper().loadClass(delegateClassName);
            }

            Constructor ctor = null;
            Object[] ctorParams = null;
            if (canUseProperties()) {
                Class[] ctorParamTypes = new Class[] { Log.class, String.class, String.class, Boolean.class };
                ctor = delegateClass.getConstructor(ctorParamTypes);
                ctorParams = new Object[] { getLog(), tablePrefix, instanceId,
                        new Boolean(canUseProperties()) };
            } else {
                Class[] ctorParamTypes = new Class[] { Log.class, String.class, String.class };
                ctor = delegateClass.getConstructor(ctorParamTypes);
                ctorParams = new Object[] { getLog(), tablePrefix, instanceId };
            }

            delegate = (DriverDelegate) ctor.newInstance(ctorParams);
        } catch (NoSuchMethodException e) {
            throw new NoSuchDelegateException("Couldn't find delegate constructor: " + e.getMessage());
        } catch (InstantiationException e) {
            throw new NoSuchDelegateException("Couldn't create delegate: " + e.getMessage());
        } catch (IllegalAccessException e) {
            throw new NoSuchDelegateException("Couldn't create delegate: " + e.getMessage());
        } catch (InvocationTargetException e) {
            throw new NoSuchDelegateException("Couldn't create delegate: " + e.getMessage());
        } catch (ClassNotFoundException e) {
            throw new NoSuchDelegateException("Couldn't load delegate class: " + e.getMessage());
        }
    }

    return delegate;
}

From source file:com.krawler.workflow.module.dao.ModuleBuilderDaoImpl.java

public String getColumndata(Object value, Hashtable<String, String> ht, String tableName,
        mb_reportlist basemodule, JSONObject jtemp, pm_taskmaster taskObj) throws ServiceException {
    String result = value.toString();
    if (ht.get("configtype").equals("combo")) {
        String columnName = ht.get("name").substring(0, ht.get("name").length() - 2);
        if (ht.get("refflag").equals("-1")) { // not combogridconfig
            try {
                Class clrefTable = value.getClass();
                Class[] arguments = new Class[] {};

                //check for delete flag
                java.lang.reflect.Method objMethod = clrefTable.getMethod("getDeleteflag", arguments);
                Object result1 = objMethod.invoke(value, new Object[] {});
                if (Double.parseDouble(result1.toString()) == 0) {
                    boolean conditionFlag = true;//ModuleBuilderController.checkFilterRules(session, taskObj, basemodule, value, 2);
                    if (conditionFlag) {
                        String methodName = "get"
                                + TextFormatter.format(getPrimaryColName(ht.get("reftable")), TextFormatter.G);
                        objMethod = clrefTable.getMethod(
                                "get" + TextFormatter.format(columnName, TextFormatter.G), arguments);
                        result1 = objMethod.invoke(value, new Object[] {});
                        result = result1.toString();
                        if (result.startsWith("com.krawler")) {
                            mb_configmasterdata mb_configmasterdata = (mb_configmasterdata) result1;
                            result = mb_configmasterdata.getMasterdata();
                        }/*from w  w  w .j a  v a  2  s  . com*/
                        objMethod = clrefTable.getMethod(methodName, arguments);
                        result1 = objMethod.invoke(value, new Object[] {});
                        result = result1.toString() + PropsValues.REPORT_HARDCODE_STR + result;

                        //fetch read only fields data
                        String SELECT_QUERY = "select mb_gridconfig.name,mb_gridconfig.displayfield,mb_gridconfig.reftable, "
                                + "mb_gridconfig.combogridconfig from com.krawler.esp.hibernate.impl.mb_gridconfig as mb_gridconfig where reportid = ? and mb_gridconfig.xtype = ? and mb_gridconfig.name like ? order by columnindex ";
                        List list = find(SELECT_QUERY, new Object[] { basemodule, "readOnlyCmp",
                                "%" + PropsValues.REPORT_HARDCODE_STR + ht.get("name") });
                        Iterator ite = list.iterator();
                        while (ite.hasNext()) {
                            Object[] row = (Object[]) ite.next();
                            String[] parentFieldName = row[0].toString().split(PropsValues.REPORT_HARDCODE_STR);

                            objMethod = clrefTable.getMethod(
                                    "get" + TextFormatter.format(parentFieldName[1], TextFormatter.G),
                                    arguments);
                            result1 = objMethod.invoke(value, new Object[] {});
                            jtemp.put(parentFieldName[0], result1.toString());
                        }
                    } else {
                        result = "conditionnotmatch";
                    }
                } else {
                    result = "deleted";
                }

            } catch (IllegalAccessException ex) {
                logger.warn(ex.getMessage(), ex);
            } catch (IllegalArgumentException ex) {
                logger.warn(ex.getMessage(), ex);
            } catch (InvocationTargetException ex) {
                logger.warn(ex.getMessage(), ex);
            } catch (NoSuchMethodException e) {
                logger.warn(e.getMessage(), e);
                throw ServiceException.FAILURE("FormServlet.getColumndata", e);
            } catch (Exception e) {
                logger.warn(e.getMessage(), e);
                throw ServiceException.FAILURE("FormServlet.getColumndata", e);
            }

        } else {
            mb_configmasterdata obj = (mb_configmasterdata) value;
            result = obj.getMasterid() + PropsValues.REPORT_HARDCODE_STR + obj.getMasterdata();
        }
    } else if (ht.get("configtype").equals("select")) {
        if (result.length() > 0) {
            String[] valueArray = result.split(",");
            String str = "(";
            for (int j = 0; j < valueArray.length; j++) {
                str += "'" + valueArray[j] + "',";
            }
            str = str.substring(0, str.length() - 1);
            str += ")";

            String sql = "";
            List li = null;
            Iterator ite = null;
            if (ht.get("refflag").equals("-1")) {// now combogridconfig
                String columnName = ht.get("name").substring(0, ht.get("name").length() - 2);
                sql = "select t1." + columnName + " from " + PropsValues.PACKAGE_PATH + "." + ht.get("reftable")
                        + " as t1  where t1.id in " + str;
                li = executeQuery(sql);
                ite = li.iterator();
                //                    rs = DbUtil.executeQuery(conn,sql,new Object[]{value});
            } else {
                sql = "select t1.masterdata as name from " + PropsValues.PACKAGE_PATH
                        + ".mb_configmasterdata as t1 where t1.configid = ? and t1.masterid in " + str
                        + " order by t1.masterdata";
                li = find(sql, new Object[] { ht.get("refflag") });
                ite = li.iterator();
                //                    rs = DbUtil.executeQuery(conn,sql, new Object[]{ht.get("reftable"),value});
            }
            str = "";
            while (ite.hasNext()) {
                str += ite.next() + ",";
            }
            str = str.length() > 0 ? str.substring(0, str.length() - 1) : "";
            result += PropsValues.REPORT_HARDCODE_STR + str;
        }
    } else if (ht.get("configtype").equals("file")) {
        if (!result.equals("")) {
            mb_docs docObj = (mb_docs) get(mb_docs.class, result);

            String Url = "fileDownload.jsp?url=" + tableName + "/" + docObj.getStorename() + "&docid=" + result
                    + "&attachment=true";
            //               String Url = "fileDownload.jsp?url="+tableName+"/"+result+"&attachment=true";
            result = "<img src='images/download.png' style='cursor: pointer;' onclick='setDldUrl(\"" + Url
                    + "\")'  title='Click to download'>";

        } else {
            result = "File not exists";
        }
    } else if (ht.get("configtype").equals("datefield")) {
        result = result.split(" ")[0];
    }
    return result;
}