List of usage examples for java.lang NoSuchMethodException printStackTrace
public void printStackTrace()
From source file:cern.molr.mole.impl.RunnableSpringMole.java
@Override public List<Method> discover(Class<?> classType) { if (null == classType) { throw new IllegalArgumentException("Class type cannot be null"); }/*from www . j av a 2 s . c o m*/ if (Runnable.class.isAssignableFrom(classType) && classType.getAnnotation(MoleSpringConfiguration.class) != null) { try { return Collections.singletonList(classType.getMethod("run")); } catch (NoSuchMethodException e) { e.printStackTrace(); } } return Collections.emptyList(); }
From source file:edu.pitt.dbmi.ccd.anno.access.AccessResourceAssembler.java
/** * Instantiate AccessResource with non-default constructor * * @param access entity//from w ww . jav a2s . com * @return resource */ @Override protected AccessResource instantiateResource(Access access) throws IllegalArgumentException { Assert.notNull(access); try { return BeanUtils.instantiateClass(AccessResource.class.getConstructor(Access.class), access); } catch (NoSuchMethodException ex) { ex.printStackTrace(); return new AccessResource(); } }
From source file:edu.pitt.dbmi.ccd.anno.group.GroupResourceAssembler.java
/** * Instantiate GroupResource with non-default constructor * * @param group entity// ww w . j av a2 s . c o m * @return resource */ @Override protected GroupResource instantiateResource(Group group) throws IllegalArgumentException { Assert.notNull(group); try { return BeanUtils.instantiateClass(GroupResource.class.getConstructor(Group.class), group); } catch (NoSuchMethodException ex) { ex.printStackTrace(); return new GroupResource(); } }
From source file:edu.pitt.dbmi.ccd.anno.vocabulary.VocabularyResourceAssembler.java
/** * Instantiate VocabularyResource with non-default constructor * * @param vocabulary entity// ww w.j ava 2 s .co m * @return resource */ @Override protected VocabularyResource instantiateResource(Vocabulary vocabulary) throws IllegalArgumentException { Assert.notNull(vocabulary); try { return BeanUtils.instantiateClass(VocabularyResource.class.getConstructor(Vocabulary.class), vocabulary); } catch (NoSuchMethodException ex) { ex.printStackTrace(); return new VocabularyResource(); } }
From source file:edu.pitt.dbmi.ccd.anno.user.UserResourceAssembler.java
/** * Instantiate UserResource with no-default constructor * * @param account entity//from w ww .jav a 2s. c om * @return resource */ @Override protected UserResource instantiateResource(UserAccount account) throws IllegalArgumentException { Assert.notNull(account); try { return BeanUtils.instantiateClass(UserResource.class.getConstructor(UserAccount.class), account); } catch (NoSuchMethodException ex) { ex.printStackTrace(); return new UserResource(); } }
From source file:edu.pitt.dbmi.ccd.anno.data.AnnotationTargetResourceAssembler.java
/** * Instantiate AnnotationTargetResource with non-default constructor * * @param target entity/*from w ww .ja v a 2 s .c o m*/ * @return resource */ @Override protected AnnotationTargetResource instantiateResource(AnnotationTarget target) throws IllegalArgumentException { Assert.notNull(target); try { return BeanUtils.instantiateClass(AnnotationTargetResource.class.getConstructor(AnnotationTarget.class), target); } catch (NoSuchMethodException ex) { ex.printStackTrace(); return new AnnotationTargetResource(); } }
From source file:org.kchine.r.tools.wsmapper.Globals.java
public static String getRClass(Class<?> javaClass) { if (RLogical.class.equals(javaClass)) return "logical"; else if (RInteger.class.equals(javaClass)) return "integer"; else if (RNumeric.class.equals(javaClass)) return "numeric"; else if (RComplex.class.equals(javaClass)) return "complex"; else if (RChar.class.equals(javaClass)) return "character"; else if (RMatrix.class.equals(javaClass)) return "matrix"; else if (RArray.class.equals(javaClass)) return "array"; else if (RList.class.equals(javaClass)) return "list"; else if (RDataFrame.class.equals(javaClass)) return "data.frame"; else if (RFactor.class.equals(javaClass)) return "factor"; else if (RFactor.class.equals(javaClass)) return "factor"; else if (REnvironment.class.equals(javaClass)) return "environment"; else {/*from ww w .j a v a2s . c o m*/ String rclass = DirectJNI._s4BeansMappingRevert.get(javaClass.getName()); if (rclass != null) { return rclass; } else { try { Method getDataMethod = javaClass.getMethod("getData", (Class[]) null); if (getDataMethod != null && javaClass.getName().endsWith("Factory")) { String shortName = javaClass.getName().substring(javaClass.getName().lastIndexOf('.') + 1); return shortName.substring(0, shortName.length() - "Factory".length()); } } catch (NoSuchMethodException ex) { ex.printStackTrace(); } } } return null; }
From source file:org.fs.ghanaian.json.JsonArrayCallback.java
/** * * @param array/*from w w w . j a v a2s. c o m*/ * @return */ public T marshall(JSONArray array) { try { Method method = clazz.getMethod("fromJsonArray", JSONArray.class); return (T) method.invoke(null, array); } catch (NoSuchMethodException ne) { ne.printStackTrace(); } catch (IllegalAccessException iea) { iea.printStackTrace(); } catch (InvocationTargetException ite) { ite.printStackTrace(); } return null; }
From source file:org.jtrfp.trcl.dbg.PropertyDumpSupport.java
public void dumpProperties(Map<String, PropertyDumpElement> dest) { PropertyDescriptor[] props = PropertyUtils.getPropertyDescriptors(delegator.getClass()); // Try to get a stacktrace. final HashMap<String, StackTraceElement[]> stackTraces = new HashMap<String, StackTraceElement[]>(); try {/*from www. j ava 2 s .c om*/ final Method sm = delegator.getClass().getDeclaredMethod("getStackTracingPropertyChangeSupport"); ((StackTracingPropertyChangeSupport) sm.invoke(delegator)).getStackTraces(stackTraces); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } for (PropertyDescriptor pd : props) { final Method rm = pd.getReadMethod(); if (rm != null) { final String name = pd.getName(); final boolean irrelevantProperty = rm.getDeclaringClass() == Object.class || name.contentEquals("class") || name.contentEquals("propertyChangeListeners"); if (!irrelevantProperty) { try { Object val = rm.invoke(delegator); try { final Method sm = rm.getReturnType().getMethod("dumpProperties", Map.class); final HashMap<String, Object> subDest = new HashMap<String, Object>(); sm.invoke(val, subDest); val = subDest; } catch (NoSuchMethodException e) { } StackTraceElement[] stackTrace = stackTraces.get(pd.getName()); PropertyDumpElement gsp = new PropertyDumpElement(val, stackTrace); dest.put(pd.getName(), gsp); } catch (Exception e) { e.printStackTrace(); } } //end if(!irrelevant) } //end if(readMethod) } //end for(props) }
From source file:edu.pitt.dbmi.ccd.anno.annotation.data.AnnotationDataResourceAssembler.java
/** * Instantiate AnnotationDataResource with non-default constructor * * @param annotation entity/* w ww .j a v a 2 s. co m*/ * @return resource */ @Override protected AnnotationDataResource instantiateResource(AnnotationData annotation) throws IllegalArgumentException { Assert.notNull(annotation); try { return BeanUtils.instantiateClass(AnnotationDataResource.class.getConstructor(AnnotationData.class), annotation); } catch (NoSuchMethodException ex) { ex.printStackTrace(); return new AnnotationDataResource(); } }