Example usage for java.lang IllegalAccessException printStackTrace

List of usage examples for java.lang IllegalAccessException printStackTrace

Introduction

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

Prototype

public void printStackTrace() 

Source Link

Document

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

Usage

From source file:me.xiaopan.android.gohttp.requestobject.RequestParser.java

/**
 * ?/* ww w .j a  v a2 s . c  o m*/
 * @param request 
 */
@SuppressWarnings("unchecked")
public static org.apache.http.Header[] parseRequestHeaders(Request request) {
    List<org.apache.http.Header> finalHeaders = null;
    for (Field field : getFields(request.getClass(), true, true, true)) {
        field.setAccessible(true);
        if (field.getAnnotation(Header.class) != null) { //???
            try {
                Object value = field.get(request);
                if (value != null) {
                    if (org.apache.http.Header.class.isAssignableFrom(field.getType())) { //?
                        if (finalHeaders == null) {
                            finalHeaders = new LinkedList<org.apache.http.Header>();
                        }
                        finalHeaders.add((org.apache.http.Header) value);
                    } else if (isArrayByType(field, org.apache.http.Header.class)) { //Header
                        org.apache.http.Header[] headers = (org.apache.http.Header[]) value;
                        for (org.apache.http.Header header : headers) {
                            if (header != null) {
                                if (finalHeaders == null) {
                                    finalHeaders = new LinkedList<org.apache.http.Header>();
                                }
                                finalHeaders.add(header);
                            }
                        }
                    } else if (isCollectionByType(field, Collection.class, org.apache.http.Header.class)) { //Header?
                        if (finalHeaders == null) {
                            finalHeaders = new LinkedList<org.apache.http.Header>();
                        }
                        finalHeaders.addAll((Collection<org.apache.http.Header>) value);
                    }
                }
            } catch (IllegalAccessException e1) {
                e1.printStackTrace();
            } catch (IllegalArgumentException e1) {
                e1.printStackTrace();
            }
        }
    }

    if (finalHeaders != null && finalHeaders.size() > 0) {
        org.apache.http.Header[] heades = new org.apache.http.Header[finalHeaders.size()];
        finalHeaders.toArray(heades);
        return heades;
    } else {
        return null;
    }
}

From source file:us.mn.state.health.lims.reports.action.implementation.LabNumberRangeParameters.java

@Override
public void setRequestParameters(BaseActionForm dynaForm) {
    try {/* w w w  .  j a  v  a  2 s .  co  m*/
        PropertyUtils.setProperty(dynaForm, "reportName", reportTitle);
        PropertyUtils.setProperty(dynaForm, "useAccessionDirect", Boolean.TRUE);
        PropertyUtils.setProperty(dynaForm, "useHighAccessionDirect", Boolean.TRUE);

    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}

From source file:com.nanyou.framework.jdbc.sql.dynamic.elements.IsNullTagHandler.java

public boolean isCondition(SqlTagContext ctx, SqlTag tag, Object parameterObject) {
    if (parameterObject == null) {
        return true;
    } else {/* w ww .java  2  s. co m*/
        String prop = getResolvedProperty(ctx, tag);
        Object value = null;
        if (prop != null) {
            try {
                value = BeanUtils.getProperty(parameterObject, prop);
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            } catch (NoSuchMethodException e) {
                e.printStackTrace();
            }
        } else {
            value = parameterObject;
        }
        return value == null;
    }
}

From source file:presenter.BaseViewPagerAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    LayoutInflater inflater = (LayoutInflater) container.getContext()
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    try {/*from   w w  w .j  a  v a 2s . c o m*/
        vu = (V) getVuClass().newInstance();
        vu.init(inflater, container);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InstantiationException e) {
        e.printStackTrace();
    }

    onBindItemVu(position);

    container.addView(vu.getView());
    return vu.getView();
}

From source file:com.kingmed.dp.service.DefaultSysPropertyService.java

@Override
public List<NDPServe> getAllNDPServes() {
    List<NDPServe> ndpServes = new ArrayList<NDPServe>();
    String section = "NDP-UPMC";
    List<SysProperty> sysProperties = sysPropertyDAO.findSysProperties(section);
    NDPServeImpl serve = new NDPServeImpl();
    for (SysProperty p : sysProperties) {
        try {//from ww  w.ja  v a  2 s.  co  m
            String code = p.getCode();
            String value = p.getValue();
            BeanUtils.setProperty(serve, code, value);
        } catch (IllegalAccessException ex) {
            ex.printStackTrace();
        } catch (InvocationTargetException ex) {
            ex.printStackTrace();
        }
    }
    return ndpServes;
}

From source file:com.mmj.app.web.validation.MatchesValidator.java

public boolean isValid(Object value, ConstraintValidatorContext context) {
    try {//from  w ww .j  a  v a2s  .  c om
        String fieldValue = BeanUtils.getProperty(value, field);
        String verifyFieldValue = BeanUtils.getProperty(value, verifyField);
        boolean valid = (fieldValue == null) && (verifyFieldValue == null);
        if (valid) {
            return true;
        }

        boolean match = (fieldValue != null) && fieldValue.equals(verifyFieldValue);
        if (!match) {
            String messageTemplate = context.getDefaultConstraintMessageTemplate();
            context.disableDefaultConstraintViolation();
            context.buildConstraintViolationWithTemplate(messageTemplate).addNode(verifyField)
                    .addConstraintViolation();
        }
        return match;
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
    return true;
}

From source file:com.grottworkshop.gwsspringindicator.ScrollerViewPager.java

public void fixScrollSpeed(int duration) throws NoSuchFieldException {
    this.duration = duration;
    try {// w  w  w . j a va  2  s  .co m
        setScrollSpeedUsingRefection(duration);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:us.mn.state.health.lims.reports.action.implementation.ReportSpecificationList.java

public void setRequestParameters(BaseActionForm dynaForm) {
    try {//from   ww w .  j a va 2s  . c  o m
        PropertyUtils.setProperty(dynaForm, "selectList", this);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}

From source file:us.mn.state.health.lims.reports.action.implementation.ReportSpecificationListName.java

public void setRequestParameters(BaseActionForm dynaForm) {
    try {/*from w ww  . j a v  a2 s.  com*/
        PropertyUtils.setProperty(dynaForm, "selectListName", this);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}

From source file:com.lonepulse.icklebot.test.fragment.support.FragmentActivityTemplate.java

/**
 * <p>Exposes {@link #onCreate(Bundle)} and allows unit tests to 
 * invoke it from an external context. Creates an instance of the 
 * fragment to be tested commits it via the support fragment manager. 
 *///from   ww  w. j av a 2 s. c  o m
@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    try {

        fragment = fragmentClass.newInstance();
    } catch (InstantiationException ie) {

        ie.printStackTrace();
    } catch (IllegalAccessException iae) {

        iae.printStackTrace();
    }

    getSupportFragmentManager().beginTransaction().add(fragment, "fragment").commit();
}