Returns the value of the {@link As} annotation if a value was specified.
Otherwise, this transforms the method name into a readable sentence and returns it.
481152
@Override
    public String as( As annotation, Method method ) {
        if( annotation != null && annotationHasExplicitValue( annotation ) ) {
            return annotation.value();
        }

        return methodNameToReadableText( method.getName() );
    }
442075
public static BooleanOperation value() {
		JcValue val = new WhenJcValue();
		BooleanOperation ret = P.valueOf(val);
		ASTNode an = APIObjectAccess.getAstNode(ret);
		an.setClauseType(ClauseType.WHEN);
		return ret;
	}
423273
private static int findIndexOfValue(final Method method) {
        int index = 0;
        for (Annotation[] annotations : method.getParameterAnnotations()) {
            for (Annotation a : annotations) {
                if (XBValue.class.equals(a.annotationType())) {
                    return index;
                }
            }
            ++index;
        }
        return 0; // If no attribute is annotated, the first one is taken.
    }
929964
private String annotationName(Annotation annotation) {
        if (annotation.annotationType().isAssignableFrom(Named.class)) {
            return ((Named) annotation).value();
        } else if ("javax.inject.Named".equals(annotation.annotationType().getName())) {
            return Jsr330Helper.getNamedValue(annotation);
        } else {
            return null;
        }
    }
885924
private static Method getMethod(Class<?> clazz, String methodName)
    {
        try
        {
            char string[] = methodName.toCharArray();
            string[0] = Character.toUpperCase(string[0]);
            methodName = new String(string);
            try
            {
                return clazz.getDeclaredMethod("get" + methodName);
            }
            catch (NoSuchMethodException e)
            {
                return clazz.getDeclaredMethod("is" + methodName);
            }
        }
        catch (NoSuchMethodException e)
        {
            return null;
        }
    }
111776
public FSArray getValue() {
    if (DiscontinuousAnnotation_Type.featOkTst && ((DiscontinuousAnnotation_Type)jcasType).casFeat_value == null)
      jcasType.jcas.throwFeatMissing("value", "de.julielab.jules.types.DiscontinuousAnnotation");
    return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((DiscontinuousAnnotation_Type)jcasType).casFeatCode_value)));}
825379
JCExpression annotationFieldValue() {
        if (LAX_IDENTIFIER.accepts(token.kind)) {
            mode = EXPR;
            JCExpression t1 = term1();
            if (t1.hasTag(IDENT) && token.kind == EQ) {
                int pos = token.pos;
                accept(EQ);
                JCExpression v = annotationValue();
                return toP(F.at(pos).Assign(t1, v));
            } else {
                return t1;
            }
        }
        return annotationValue();
    }
312832
public AnnotationVisitor getAnnotationVisitor() {
        return new AnnotationVisitor(FindBugsASM.ASM_VERSION) {
            @Override
            public void visit(String name, Object value) {
                name = canonicalString(name);
                valueMap.put(name, value);
            }

            /*
             * (non-Javadoc)
             *
             * @see
             * org.objectweb.asm.AnnotationVisitor#visitAnnotation(java.lang
             * .String, java.lang.String)
             */
            @Override
            public AnnotationVisitor visitAnnotation(String name, String desc) {
                name = canonicalString(name);
                AnnotationValue newValue = new AnnotationValue(desc);
                valueMap.put(name, newValue);
                typeMap.put(name, desc);
                return newValue.getAnnotationVisitor();
            }

            /*
             * (non-Javadoc)
             *
             * @see
             * org.objectweb.asm.AnnotationVisitor#visitArray(java.lang.String)
             */
            @Override
            public AnnotationVisitor visitArray(String name) {
                name = canonicalString(name);
                return new AnnotationArrayVisitor(name);
            }

            /*
             * (non-Javadoc)
             *
             * @see org.objectweb.asm.AnnotationVisitor#visitEnd()
             */
            @Override
            public void visitEnd() {

            }

            /*
             * (non-Javadoc)
             *
             * @see
             * org.objectweb.asm.AnnotationVisitor#visitEnum(java.lang.String,
             * java.lang.String, java.lang.String)
             */
            @Override
            public void visitEnum(String name, String desc, String value) {
                name = canonicalString(name);
                valueMap.put(name, new EnumValue(desc, value));
                typeMap.put(name, desc);

            }
        };
    }
1075608
public String getAspect() {
    if (VerbFeats_Type.featOkTst && ((VerbFeats_Type)jcasType).casFeat_aspect == null)
      jcasType.jcas.throwFeatMissing("aspect", "de.julielab.jules.types.VerbFeats");
    return jcasType.ll_cas.ll_getStringValue(addr, ((VerbFeats_Type)jcasType).casFeatCode_aspect);}
154272
public static String getTypeValue(Class<? extends WindupFrame> clazz)
    {
        TypeValue typeValueAnnotation = clazz.getAnnotation(TypeValue.class);
        if (typeValueAnnotation == null)
            throw new IllegalArgumentException("Class " + clazz.getCanonicalName() + " lacks a @TypeValue annotation");

        return typeValueAnnotation.value();
    }
445577
public String getStringValueFromModel(FacesContext context)
        throws ConverterException {
        ValueExpression ve = getValueExpression("value");
        if (ve == null) {
            return null;
        }

        Object currentValue = ve.getValue(context.getELContext());

        // If there is a converter attribute, use it to to ask application
        // instance for a converter with this identifer.
        Converter c = getConverter();

        if (c == null) {
            // if value is null and no converter attribute is specified, then
            // return null (null has meaning for a view parameters; it means remove it).
            if (currentValue == null) {
                return null;
            }
            // Do not look for "by-type" converters for Strings
            if (currentValue instanceof String) {
                return (String) currentValue;
            }

            // if converter attribute set, try to acquire a converter
            // using its class type.

            Class converterType = currentValue.getClass();
            c = context.getApplication().createConverter(converterType);

            // if there is no default converter available for this identifier,
            // assume the model type to be String.
            if (c == null) {
                return currentValue.toString();
            }
        }

        return c.getAsString(context, this, currentValue);
    }
1283378
public String getGeneratedValueAnnotation() {
        if (useSequenceNameShortcut()) {
            return getGeneratedValueForSequenceNameByConfiguration();
        }

        if (attribute.getColumnConfig().useConfigForIdGenerator()) {
            // TODO: explain why we do not directly check attribute.getColumnConfig().hasGeneratedValue() in the if statement above.
            return getGeneratedValueAnnotationByConfiguration();
        } else if (attribute.getAutoIncrement() == TRUE && !attribute.isSimpleFk()) {
            // the jdbc driver supports IS_AUTOINCREMENT metadata, great!
            // if it is an fk, we do not want @GeneratedValue because we use instead @MapsId on the association...
            addImport("javax.persistence.GeneratedValue");
            addImport("static javax.persistence.GenerationType.IDENTITY");
            return "@GeneratedValue(strategy = IDENTITY)";
        } else if (attribute.getAutoIncrement() == FALSE && /* 32 length string are special for us */!attribute.isString()) {
            // the jdbc driver supports IS_AUTOINCREMENT metadata, great!
            return "";
        } else {
            // the jdbc driver does not support IS_AUTOINCREMENT
            // fall back to convention
            return getGeneratedValueAnnotationByConvention();
        }
    }
193492
protected String getMethodSignature(MethodDeclaration m) {
    StringBuilder sb = new StringBuilder();
    ExecutableElement element = m.getExecutableElement();
    char prefix = Modifier.isStatic(m.getModifiers()) ? '+' : '-';
    String returnType = nameTable.getObjCType(element.getReturnType());
    String selector = nameTable.getMethodSelector(element);
    if (m.isConstructor()) {
      returnType = "instancetype";
    } else if (selector.equals("hash")) {
      // Explicitly test hashCode() because of NSObject's hash return value.
      returnType = "NSUInteger";
    }
    sb.append(UnicodeUtils.format("%c (%s%s)", prefix, returnType, nullability(element)));

    List<SingleVariableDeclaration> params = m.getParameters();
    String[] selParts = selector.split(":");

    if (params.isEmpty()) {
      assert selParts.length == 1 && !selector.endsWith(":");
      sb.append(selParts[0]);
    } else {
      assert params.size() == selParts.length;
      int baseLength = sb.length() + selParts[0].length();
      for (int i = 0; i < params.size(); i++) {
        if (i != 0) {
          sb.append('\n');
          sb.append(pad(baseLength - selParts[i].length()));
        }
        VariableElement var = params.get(i).getVariableElement();
        String typeName = nameTable.getObjCType(var.asType());
        sb.append(
            UnicodeUtils.format(
                "%s:(%s%s)%s",
                selParts[i], typeName, nullability(var), nameTable.getVariableShortName(var)));
      }
    }

    return sb.toString();
  }
556215
private static String value(String nameEqualsValue) {
        int idx = nameEqualsValue.indexOf('=');
        String value = nameEqualsValue.substring(idx + 1).trim();
        return QuotedStringTokenizer.unquoteOnly(value);
    }
1138945
public static <T extends Enum<T>> T getElementValueEnum(AnnotationMirror anno, CharSequence name, Class<T> t, boolean useDefaults) {
        Symbol.VarSymbol vs = getElementValue(anno, name, Symbol.VarSymbol.class, useDefaults);
        T value = Enum.valueOf(t, vs.getSimpleName().toString());
        return value;
    }
118984
public ValueBinding getValueBinding(String name) {

        if (name == null) {
            throw new NullPointerException();
        }
        ValueBinding result = null;
        ValueExpression ve;

        if (null != (ve = getValueExpression(name))) {
            // if the ValueExpression is an instance of our private
            // wrapper class.
            if (ve.getClass().equals(ValueExpressionValueBindingAdapter.class)) {
                result = ((ValueExpressionValueBindingAdapter) ve).getWrapped();
            } else {
                // otherwise, this is a real ValueExpression.  Wrap it
                // in a ValueBinding.
                result = new ValueBindingValueExpressionAdapter(ve);
            }
        }
        return result;
    }
578118
public String getTag(final Method method) {
        final Annotation[] annotations = method.getAnnotations();
        return this.getTag(annotations, method);
    }