List of usage examples for java.lang IllegalAccessException printStackTrace
public void printStackTrace()
From source file:org.edgexfoundry.serviceactivator.IotCoreMQTTOutboundServiceActivatorTest.java
@Before public void setup() { activator = new IotCoreMQTTOutboundServiceActivator(); string = ExportStringData.newTestInstance(); string.setEventString(TEST_STRING);//from w ww . jav a 2s .co m string.setEventId(TEST_ID); Addressable addressable = new Addressable(TEST_STRING, Protocol.OTHER, TEST_ADDRESS, TEST_PORT, TEST_PUBLISHER, TEST_USER, TEST_PASSWORD, TEST_TOPIC); ExportRegistration er = new ExportRegistration(); er.setAddressable(addressable); string.setRegistration(er, TEST_ID); message = MessageBuilder.withPayload(string).build(); try { FieldUtils.writeField(activator, "privateKeyFile", "rsa_private_pkcs8", true); FieldUtils.writeField(activator, "algorithm", "RS256", true); } catch (IllegalAccessException e) { e.printStackTrace(); } }
From source file:org.openremote.beehive.api.service.impl.RemoteOptionServiceImpl.java
public List<RemoteOptionDTO> findByRemoteSectionId(long remoteSectionId) { RemoteSection remoteSection = genericDAO.loadById(RemoteSection.class, remoteSectionId); List<RemoteOptionDTO> remoteOptionDTOs = new ArrayList<RemoteOptionDTO>(); for (RemoteOption remoteOption : remoteSection.getRemoteOptions()) { RemoteOptionDTO remoteOptionDTO = new RemoteOptionDTO(); try {/* w ww . j a v a2s. c o m*/ BeanUtils.copyProperties(remoteOptionDTO, remoteOption); } catch (IllegalAccessException e) { // TODO handle exception e.printStackTrace(); } catch (InvocationTargetException e) { // TODO handle exception e.printStackTrace(); } remoteOptionDTOs.add(remoteOptionDTO); } return remoteOptionDTOs; }
From source file:com.grottworkshop.gwsspringindicator.viewpager.ScrollerViewPager.java
/** * * @param duration the duration int/*from w ww .java2s . c o m*/ */ public void fixScrollSpeed(int duration) throws NoSuchFieldException { this.duration = duration; try { setScrollSpeedUsingRefection(duration); } catch (IllegalAccessException e) { e.printStackTrace(); } }
From source file:org.openremote.beehive.api.service.impl.CodeServiceImpl.java
public List<CodeDTO> findByRemoteSectionId(long remoteSectionId) { List<CodeDTO> codeDTOs = new ArrayList<CodeDTO>(); RemoteSection remoteSection = genericDAO.loadById(RemoteSection.class, remoteSectionId); for (Code code : remoteSection.getCodes()) { CodeDTO codeDTO = new CodeDTO(); try {//w ww. ja va 2s. c om BeanUtils.copyProperties(codeDTO, code); codeDTO.setRemoteName(code.getRemoteSection().getRemoteOptions().get(0).getValue()); } catch (IllegalAccessException e) { // TODO handle exception e.printStackTrace(); } catch (InvocationTargetException e) { // TODO handle exception e.printStackTrace(); } codeDTOs.add(codeDTO); } return codeDTOs; }
From source file:org.fs.ghanaian.json.JsonArrayCallback.java
/** * * @param array/*from ww w . j av a 2 s .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:me.bogeymanEST.cmdhelper.output.Output.java
/** * Gets the JSON-like representation of this object's fields for usage in Minecraft. * The only difference between JSON and the format Minecraft expects seems to be the lack of quotes around field names. * This is unfortunately difficult to achieve with JSON libraries (like GSON). * <p/>/*from w w w .ja v a2s .co m*/ * If the given object is a primitive type (or the corresponding boxed type) or a string, the given value is returned instead of * looking through its fields. * * @param o The object * @return String representation of the object */ public String get(Object o) { if (o == null) return ""; StringBuilder sb = new StringBuilder(); if (o instanceof String) return '"' + o.toString().replace("\"", "\\\"") + '"'; if (o instanceof Long || o instanceof Byte || o instanceof Short || o instanceof Integer) return o.toString(); if (o instanceof Boolean) return (Boolean) o ? "1" : "0"; sb.append("{"); stackLevel++; List<String> elements = new ArrayList<String>(); for (Field field : o.getClass().getFields()) { Object val; StringBuilder sbElement = new StringBuilder(); try { val = field.get(o); if (val != null) { sbElement.append(newLine()); sbElement.append(field.getName()).append(":").append(get(val)); elements.add(sbElement.toString()); } } catch (IllegalAccessException e) { e.printStackTrace(); } } sb.append(StringUtils.join(elements, ",")); stackLevel--; if (elements.size() > 0) sb.append(newLine()); sb.append("}"); return sb.toString(); }
From source file:com.dalaran.annotation.FieldMerge.java
private boolean checkToMerge(Fragment fragment, Field field, ViewById annotation, View view) { field.setAccessible(true);/*from w w w .j a v a2 s. c om*/ View viewById = view.findViewById(annotation.value()); try { field.set(fragment, viewById); } catch (IllegalAccessException e) { e.printStackTrace(); } return false; }
From source file:org.sylvani.bot.util.SessionPropertyModel.java
@Override public void setObject(T object, ISession session) { Object target = session.getAttribute(name); try {//ww w . ja v a2 s. c o m PropertyUtils.setProperty(target, name, object); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (NoSuchMethodException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
From source file:org.sylvani.bot.util.SessionPropertyModel.java
@Override public T getObject(ISession session) { Object target = session.getAttribute(name); try {/* w ww . ja va 2s . c o m*/ return (T) PropertyUtils.getProperty(target, name); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (NoSuchMethodException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
From source file:org.lunifera.ecview.core.common.uri.FragmentScope.java
public Object access(Object bean) { Object result = null;/*from w w w .j a v a 2 s . c o m*/ try { result = PropertyUtils.getProperty(bean, selector); } catch (IllegalAccessException e) { logger.error("{}", e); e.printStackTrace(); } catch (InvocationTargetException e) { logger.error("{}", e); e.printStackTrace(); } catch (NoSuchMethodException e) { logger.error("{}", e); e.printStackTrace(); } return result; }