Example usage for java.lang IllegalAccessError IllegalAccessError

List of usage examples for java.lang IllegalAccessError IllegalAccessError

Introduction

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

Prototype

public IllegalAccessError(String s) 

Source Link

Document

Constructs an IllegalAccessError with the specified detail message.

Usage

From source file:Main.java

public static boolean readFlagsBit(byte paramByte, int paramInt) {
    if (paramInt > 7)
        throw new IllegalAccessError("readFlagsBit error index>7!!! ");
    return (0x1 & paramByte << 7 - paramInt >> 7) == 1;
}

From source file:Main.java

private static void checkMustInUiThread() {
    if (Looper.getMainLooper() != Looper.myLooper()) {
        throw new IllegalAccessError("this method must  call in ui thread!!");
    }/*from ww  w  .j a  va2s .  c o  m*/
}

From source file:Main.java

public static Object getObjectField(Object obj, String fieldName) {
    try {// w w w.  j ava2  s. c  o  m
        return findField(obj.getClass(), fieldName).get(obj);
    } catch (IllegalAccessException e) {
        // should not happen
        Log.v("test", e.getMessage());
        throw new IllegalAccessError(e.getMessage());
    } catch (IllegalArgumentException e) {
        throw e;
    }
}

From source file:Main.java

public static int getIntField(Object obj, String fieldName) {
    try {/*from w  w  w . j a va2s . co  m*/
        return findField(obj.getClass(), fieldName).getInt(obj);
    } catch (IllegalAccessException e) {
        // should not happen
        //XposedBridge.log(e);
        Log.v("test", e.getMessage());
        throw new IllegalAccessError(e.getMessage());
    } catch (IllegalArgumentException e) {
        throw e;
    }
}

From source file:Main.java

public static String documentToString(Node document) {
    try {/*from ww  w  . j a va  2s  .  c  o m*/
        StringWriter sw = new StringWriter();
        TransformerFactory tf = TransformerFactory.newInstance();
        Transformer transformer = tf.newTransformer();
        transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
        transformer.setOutputProperty(OutputKeys.METHOD, "xml");
        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
        transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
        transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
        transformer.transform(new DOMSource(document), new StreamResult(sw));
        return sw.toString().replace("\r\n", "\n");
    } catch (TransformerException e) {
        throw new IllegalAccessError("Couldn't transform document to string");
    }
}

From source file:com.daimler.spm.storefront.util.QuoteExpirationTimeConverter.java

private QuoteExpirationTimeConverter() {
    throw new IllegalAccessError("Utility class may not be instantiated");
}

From source file:io.github.mbarre.schemacrawler.utils.JSonUtils.java

private JSonUtils() {
    throw new IllegalAccessError("Utility class.");
}

From source file:org.eclipse.smarthome.core.scheduler.CronHelper.java

/** Constructor */
private CronHelper() {
    throw new IllegalAccessError("Non-instantiable");
}

From source file:com.eryansky.common.orm.core.PropertyFilters.java

/**
 * ?/*w w w  . ja  va 2 s .c o m*/
 * <p>
 *    
 * </p>
 * <code>
 *    PropertyFilters.get("EQS_propertyName","maurice")
 * </code>
 * 
 * @param expression ?
 * @param matchValue 
 * 
 * @return {@link PropertyFilter}
 */
@SuppressWarnings("static-access")
public static PropertyFilter get(String expression, String matchValue) {

    Assert.hasText(expression, "??");

    String restrictionsNameAndClassType = StringUtils.substringBefore(expression, "_");

    String restrictionsName = StringUtils.substring(restrictionsNameAndClassType, 0,
            restrictionsNameAndClassType.length() - 1);
    String classType = StringUtils.substring(restrictionsNameAndClassType,
            restrictionsNameAndClassType.length() - 1, restrictionsNameAndClassType.length());

    FieldType FieldType = null;
    try {
        FieldType = FieldType.valueOf(classType);
    } catch (Exception e) {
        throw new IllegalAccessError(
                "[" + expression + "]??,?:" + classType);
    }

    String[] propertyNames = null;

    if (StringUtils.contains(expression, "_OR_")) {
        String temp = StringUtils.substringAfter(expression, restrictionsNameAndClassType + "_");
        propertyNames = StringUtils.splitByWholeSeparator(temp, "_OR_");
    } else {
        propertyNames = new String[1];
        propertyNames[0] = StringUtils.substringAfterLast(expression, "_");
    }

    return new PropertyFilter(restrictionsName, FieldType, propertyNames, matchValue);
}

From source file:com.github.dactiv.orm.core.PropertyFilters.java

/**
 * ?/*  ww w .  ja  va 2  s .co  m*/
 * <p>
 *    
 * </p>
 * <code>
 *    PropertyFilters.build("EQS_propertyName","maurice")
 * </code>
 * 
 * @param expression ?
 * @param matchValue 
 * 
 * @return {@link PropertyFilter}
 */
@SuppressWarnings("static-access")
public static PropertyFilter build(String expression, String matchValue) {

    Assert.hasText(expression, "??");

    String restrictionsNameAndClassType = StringUtils.substringBefore(expression, "_");

    String restrictionsName = StringUtils.substring(restrictionsNameAndClassType, 0,
            restrictionsNameAndClassType.length() - 1);
    String classType = StringUtils.substring(restrictionsNameAndClassType,
            restrictionsNameAndClassType.length() - 1, restrictionsNameAndClassType.length());

    FieldType FieldType = null;
    try {
        FieldType = FieldType.valueOf(classType);
    } catch (Exception e) {
        throw new IllegalAccessError(
                "[" + expression + "]??,?:" + classType);
    }

    String[] propertyNames = null;

    if (StringUtils.contains(expression, "_OR_")) {
        String temp = StringUtils.substringAfter(expression, restrictionsNameAndClassType + "_");
        propertyNames = StringUtils.splitByWholeSeparator(temp, "_OR_");
    } else {
        propertyNames = new String[1];
        propertyNames[0] = StringUtils.substringAfterLast(expression, "_");
    }

    return new PropertyFilter(restrictionsName, FieldType, propertyNames, matchValue);
}