Package org.apache.bcel.classfile

Examples of org.apache.bcel.classfile.ElementValue


        } else {
            return;
        }
        JCIPAnnotationDatabase annotationDatabase = AnalysisContext.currentAnalysisContext()
                .getJCIPAnnotationDatabase();
        ElementValue value = map.get("value");
        ClassMember member;
        if (visitingField()) {
            member = XFactory.createXField(this);
        } else if (visitingMethod()) {
            member = XFactory.createXMethod(this);
View Full Code Here


                Target annotationTarget = defaultKind.get(annotationClass);
                if (annotationTarget != Target.METHOD) {
                    return;
                }

                ElementValue v = map.get("value");
                if (v instanceof ClassElementValue) {
                    handleClassElementValue((ClassElementValue) v, annotationTarget);
                } else if (v instanceof ArrayElementValue) {
                    for (ElementValue v2 : ((ArrayElementValue) v).getElementValuesArray()) {
                        if (v2 instanceof ClassElementValue) {
View Full Code Here

            Target annotationTarget = defaultKind.get(annotationClassSimpleName);
            if (annotationTarget != Target.METHOD) {
                return;
            }

            ElementValue v = map.get("value");
            if (v instanceof ClassElementValue) {
                handleClassElementValue((ClassElementValue) v, map, annotationTarget);
            } else if (v instanceof ArrayElementValue) {
                for (ElementValue v2 : ((ArrayElementValue) v).getElementValuesArray()) {
                    if (v2 instanceof ClassElementValue) {
                        handleClassElementValue((ClassElementValue) v2, map, annotationTarget);
                    }
                }
            }

            return;
        }

        CheckReturnValueAnnotation n;

        if (annotationClassName.equals(javax.annotation.CheckReturnValue.class.getName())) {
            ElementValue v = map.get("when");
            if (v instanceof EnumElementValue) {
                EnumElementValue when = (EnumElementValue) v;
                String w = simpleClassName(when.getEnumValueString());
                if (w.equals("NEVER") || w.equals("UNKNOWN")) {
                    n = CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE;
View Full Code Here

            }
            boolean notThreadSafe = jcipAnotationDatabase.hasClassAnnotation(xfield.getClassName(), "NotThreadSafe");
            if (notThreadSafe) {
                continue;
            }
            ElementValue guardedByValue = jcipAnotationDatabase.getFieldAnnotation(xfield, "GuardedBy");
            boolean guardedByThis;
            if(guardedByValue != null){
                guardedByThis = guardedByValue.stringifyValue().equals("this");
            } else {
                guardedByThis = false;
            }
            boolean threadSafe = jcipAnotationDatabase.hasClassAnnotation(xfield.getClassName(), "ThreadSafe");
View Full Code Here

        }
    }

    protected static String getAnnotationParameterAsString(Map<String, ElementValue> map, String parameter) {
        try {
            ElementValue ev = map.get(parameter);

            if (ev instanceof SimpleElementValue) {
                return ((SimpleElementValue) ev).getValueString();
            }
            return null;
View Full Code Here

    @CheckForNull
    @SuppressFBWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS")
    protected static String[] getAnnotationParameterAsStringArray(Map<String, ElementValue> map, String parameter) {
        try {
            ElementValue e = map.get(parameter);
            ArrayElementValue a = (ArrayElementValue) e;
            int size = a.getElementValuesArraySize();
            String[] result = new String[size];
            ElementValue[] elementValuesArray = a.getElementValuesArray();
            for (int i = 0; i < size; i++) {
View Full Code Here

  /**
   * Retrieve an immutable version of this ElementNameValuePairGen
   */
  public ElementValuePair getElementNameValuePair()
  {
    ElementValue immutableValue = value.getElementValue();
    return new ElementValuePair(nameIdx, immutableValue, cpool
        .getConstantPool());
  }
View Full Code Here

TOP

Related Classes of org.apache.bcel.classfile.ElementValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.