private TransactionSupport.TransactionSupportLevel asTransactionSupportLocal(final AnnotationInstance annotation, String property) { AnnotationValue value = annotation.value(property); return value == null ? null : TransactionSupport.TransactionSupportLevel.valueOf((String)value.value()); }
@Override public Object getValue() { return annotationValue.value(); }
/** * Returns the string representation of the underlying value type. * The representation may or may not be convertible to the type * it represents. This is best used on String types, but can also * provide a useful way to quickly convert a value to a String. * * @return a string representing the value parameter */ public String asString() { return value().toString(); }
public String toString() { StringBuilder builder = new StringBuilder(); if (name.length() > 0) builder.append(name).append(" = "); return builder.append(value()).toString(); }
private static <T> T explicitAnnotationParameter(AnnotationValue annotationValue, Class<T> type) { Object returnValue = annotationValue.value(); // if the jandex return type is Type we actually try to retrieve a class parameter // for our purposes we just return the fqcn of the class if ( returnValue instanceof Type ) { returnValue = ( (Type) returnValue ).name().toString(); } // arrays we have to handle explicitly if ( type.isArray() ) { AnnotationValue[] values = (AnnotationValue[]) returnValue; Class<?> componentType = type.getComponentType(); Object[] arr = (Object[]) Array.newInstance( componentType, values.length ); for ( int i = 0; i < values.length; i++ ) { arr[i] = componentType.cast( values[i].value() ); } returnValue = arr; } return type.cast( returnValue ); } }
private static <T> T explicitAnnotationParameter(AnnotationValue annotationValue, Class<T> type) { Object returnValue = annotationValue.value(); // if the jandex return type is Type we actually try to retrieve a class parameter // for our purposes we just return the fqcn of the class if ( returnValue instanceof Type ) { returnValue = ( (Type) returnValue ).name().toString(); } // arrays we have to handle explicitly if ( type.isArray() ) { AnnotationValue[] values = (AnnotationValue[]) returnValue; Class<?> componentType = type.getComponentType(); Object[] arr = (Object[]) Array.newInstance( componentType, values.length ); for ( int i = 0; i < values.length; i++ ) { arr[i] = componentType.cast( values[i].value() ); } returnValue = arr; } return type.cast( returnValue ); } }
private TransactionSupport.TransactionSupportLevel asTransactionSupportLocal(final AnnotationInstance annotation, String property) { AnnotationValue value = annotation.value(property); return value == null ? null : TransactionSupport.TransactionSupportLevel.valueOf((String)value.value()); }
ElementValuePair[] paramNames = annotationDesc.elementValues(); AnnotationValue[] statusCodes = (AnnotationValue[])paramNames[0].value().value(); if(statusCodes==null||statusCodes.length==0) { return statusCodeValue; } for(AnnotationValue statusCode:statusCodes) { AnnotationDesc anoDesc=(AnnotationDesc)statusCode.value(); if(anoDesc==null) { return statusCodeValue; } String key=(String)anoDesc.elementValues()[0].value().value(); String value=(String)anoDesc.elementValues()[1].value().value(); }
AnnotationTarget target = ai.target(); if (target.kind() == AnnotationTarget.Kind.CLASS) { Object value = ai.value().value(); if (value != null) { applicationPaths.add(String.valueOf(value));
for (AnnotationInstance anDeployment : getAnnotations(depUnit, "org.jboss.arquillian.container.test.api.Deployment")) { AnnotationValue namevalue = anDeployment.value("name"); Object deploymentName = namevalue != null ? namevalue.value() : null; if (slTarget == anDeployment.target() && depUnit.getName().equals(deploymentName)) { int startLevel = slAware.value("startLevel").asInt();
for (AnnotationInstance anDeployment : getAnnotations(depUnit, "org.jboss.arquillian.container.test.api.Deployment")) { AnnotationValue namevalue = anDeployment.value("name"); Object deploymentName = namevalue != null ? namevalue.value() : null; if (slTarget == anDeployment.target() && depUnit.getName().equals(deploymentName)) { int startLevel = slAware.value("startLevel").asInt();