Example usage for java.lang NoSuchMethodException printStackTrace

List of usage examples for java.lang NoSuchMethodException printStackTrace

Introduction

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

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:edu.pitt.dbmi.ccd.anno.vocabulary.attribute.AttributeResourceAssembler.java

/**
 * Instantiate AttributeResource with non-default constructor
 *
 * @param attribute entity//from  ww  w . j  a v a2s. com
 * @return resource
 */
@Override
protected AttributeResource instantiateResource(Attribute attribute) {
    Assert.notNull(attribute);
    try {
        return BeanUtils.instantiateClass(AttributeResource.class.getConstructor(Attribute.class), attribute);
    } catch (NoSuchMethodException ex) {
        ex.printStackTrace();
        return new AttributeResource();
    }
}

From source file:edu.pitt.dbmi.ccd.anno.annotation.AnnotationResourceAssembler.java

/**
 * Instantiate AnnotationResource with non-default constructor
 *
 * @param annotation entity//from   w  w w.j av  a 2  s  . c om
 * @return resource
 */
@Override
protected AnnotationResource instantiateResource(Annotation annotation) throws IllegalArgumentException {
    Assert.notNull(annotation);
    try {
        return BeanUtils.instantiateClass(AnnotationResource.class.getConstructor(Annotation.class),
                annotation);
    } catch (NoSuchMethodException ex) {
        ex.printStackTrace();
        return new AnnotationResource();
    }
}

From source file:com.bluelinelabs.logansquare.typeconverters.PendingIntentConverter.java

private boolean isActivity(PendingIntent pintent) {
    boolean isActivity = false;
    try {/*from   w ww  . j  ava2  s  .c  o  m*/
        Method isActivityMethod = pintent.getClass().getMethod("isActivity");
        isActivity = (boolean) isActivityMethod.invoke(pintent);
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
    return isActivity;
}

From source file:com.bluelinelabs.logansquare.typeconverters.PendingIntentConverter.java

@Nullable
private Intent getIntent(PendingIntent pintent) {
    Intent intent = null;//w ww  .  j a  va  2 s. co  m
    try {
        Method getIntentMethod = pintent.getClass().getMethod("getIntent");
        intent = (Intent) getIntentMethod.invoke(pintent);
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
    return intent;
}

From source file:com.ehi.carshare.Main.java

private void printAllPossibles(String logformat) {
    Parser<Object> dummyParser = new HttpdLoglineParser<Object>(Object.class, logformat);

    List<String> possiblePaths;
    possiblePaths = dummyParser.getPossiblePaths();

    try {/*from  ww w  . ja v  a2s .  com*/
        dummyParser.addParseTarget(String.class.getMethod("indexOf", String.class), possiblePaths);
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
        return;
    }

    LOG.info("==================================");
    LOG.info("Possible output:");
    for (String path : possiblePaths) {
        LOG.info("{}     {}", path, dummyParser.getCasts(path));
    }
    LOG.info("==================================");
}

From source file:com.superyu.slidingmenu.SlidingMenu02.java

/**
 **??/* w  w w  .ja  v  a 2  s.c o  m*/
 **/

@Override
public boolean onMenuOpened(int featureId, Menu menu) {

    if (featureId == Window.FEATURE_ACTION_BAR && menu != null) {
        if (menu.getClass().getSimpleName().equals("MenuBuilder")) {
            try {
                Method m = menu.getClass().getDeclaredMethod("setOptionalIconsVisible", Boolean.TYPE);
                m.setAccessible(true);
                m.invoke(menu, true);
            } catch (NoSuchMethodException e) {
                e.printStackTrace();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }

    return super.onMenuOpened(featureId, menu);
}

From source file:org.fs.ghanaian.json.JsonObjectCallback.java

/**
 *
 * @param data//w w  w  .ja va2 s  .  c o  m
 * @return
 */
public T marshall(JSONObject data) {
    try {
        Method method = clazz.getMethod("fromJsonObject", JSONObject.class);
        return (T) method.invoke(null, data);
    } catch (NoSuchMethodException ne) {
        ne.printStackTrace();
    } catch (IllegalAccessException iae) {
        iae.printStackTrace();
    } catch (InvocationTargetException ite) {
        ite.printStackTrace();
    }
    return null;
}

From source file:org.fs.ghanaian.json.JsonObjectCallback.java

/***
 *
 * @param data/* w ww. j  a v a  2s. c o  m*/
 * @return
 */
public T marshall(JSONArray data) {
    try {
        Method method = clazz.getMethod("fromJsonArray", JSONArray.class);
        return (T) method.invoke(null, data);
    } catch (NoSuchMethodException ne) {
        ne.printStackTrace();
    } catch (IllegalAccessException iae) {
        iae.printStackTrace();
    } catch (InvocationTargetException ite) {
        ite.printStackTrace();
    }
    return null;
}

From source file:edu.umass.cs.reconfiguration.reconfigurationprotocoltasks.ActiveReplicaProtocolTask.java

@SuppressWarnings("unchecked")
@Override// w w  w .  j  av  a 2  s .c om
public GenericMessagingTask<NodeIDType, ?>[] handleEvent(
        ProtocolEvent<ReconfigurationPacket.PacketType, String> event,
        ProtocolTask<NodeIDType, ReconfigurationPacket.PacketType, String>[] ptasks) {

    ReconfigurationPacket.PacketType type = event.getType();
    Object returnValue = null;
    try {
        if (ReconfigurationPacket.getPacketTypeClass(type) != null)
            returnValue = this.activeReplica.getClass()
                    .getMethod(HANDLER_METHOD_PREFIX + ReconfigurationPacket.getPacketTypeClassName(type),
                            ReconfigurationPacket.getPacketTypeClass(type), ProtocolTask[].class)
                    .invoke(this.activeReplica, (BasicReconfigurationPacket<?>) event, ptasks);
        else
            assert (false);
    } catch (NoSuchMethodException nsme) {
        nsme.printStackTrace();
    } catch (InvocationTargetException ite) {
        ite.printStackTrace();
    } catch (IllegalAccessException iae) {
        iae.printStackTrace();
    }
    return (GenericMessagingTask<NodeIDType, ?>[]) returnValue;
}

From source file:org.jtrfp.trcl.flow.IndirectProperty.java

private void fireAllPropertiesChanged() {
    PROPERTY_TYPE target = this.target.get();
    if (target == null)
        return;//from   ww  w. j  a v a2  s . c  om
    HashSet<String> propertiesToFireChanged = new HashSet<String>();
    PropertyChangeListener[] listeners = targetPCS.getPropertyChangeListeners();
    for (PropertyChangeListener l : listeners) {
        if (l instanceof PropertyChangeListenerProxy) {
            final PropertyChangeListenerProxy prox = (PropertyChangeListenerProxy) l;
            propertiesToFireChanged.add(prox.getPropertyName());
        } //end if(...)
    } //end for(listener)
    for (String propertyName : propertiesToFireChanged) {
        try {
            targetPCS.firePropertyChange(propertyName, null, PropertyUtils.getProperty(target, propertyName));
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    } //end for(propertyNames)
}