new ArrayList<AnnotationAttributeValue<?>>(); for (AnnotationMetadataBuilder joinColumnAnnotation : joinColumnsBuilders) { joinColumnsAnnotations.add(new NestedAnnotationAttributeValue(new JavaSymbolName( "joinColumns"), joinColumnAnnotation.build())); new ArrayList<AnnotationAttributeValue<?>>(); for (AnnotationMetadataBuilder inverseJoinColumnsAnnotation : inverseJoinColumnsBuilders) { inverseJoinColumnsAnnotations.add(new NestedAnnotationAttributeValue(new JavaSymbolName( "inverseJoinColumns"), inverseJoinColumnsAnnotation.build())); new ArrayList<AnnotationAttributeValue<?>>(); for (AnnotationMetadataBuilder joinColumnAnnotation : joinColumnsBuilders) { joinColumnsAnnotations.add(new NestedAnnotationAttributeValue( new JavaSymbolName("value"), joinColumnAnnotation.build()));
/** * Gets value of a nested annotation attribute value * * @param newstedAnnotationAttr * @param attributeName * @return */ private <T> T getNestedAttributeValue(NestedAnnotationAttributeValue nestedAnnotationAttr, String attributeName) { AnnotationMetadata annotationValue = nestedAnnotationAttr.getValue(); if (annotationValue == null) { return null; } AnnotationAttributeValue<?> attribute = annotationValue.getAttribute(attributeName); if (attribute == null) { return null; } return (T) attribute.getValue(); }
@Override public String toString() { return getName() + " -> " + value.toString(); } }
exceptionHandlersArrayValues.add(new NestedAnnotationAttributeValue(new JavaSymbolName(VALUE), exceptionHandlerAnnotationBuilder.build())); while (it.hasNext()) { NestedAnnotationAttributeValue handler = (NestedAnnotationAttributeValue) it.next(); if (handler.getValue() != null) { .equals(handler.getValue().getAttribute(EXCEPTION).getValue())) { LOGGER.warning(String.format( "There is already a handler for exception %s in class %s",
if (finder.getValue() != null && finder.getValue().getAttribute("value") != null) { if (finder.getValue().getAttribute("value").getValue().equals(finderName.getSymbolName())) { LOGGER.log( Level.WARNING, new NestedAnnotationAttributeValue(new JavaSymbolName("value"), singleFinderAnnotation.build());
(NestedAnnotationAttributeValue) it.next(); String existingEndpointName = (String) existingEndPoint.getValue().getAttribute("endpoint").getValue(); if (existingEndpointName.equals(endPoint)) { alreadyManaged = true; (NestedAnnotationAttributeValue) iterator.next(); String existingEndpointName = (String) existingEndPoint.getValue().getAttribute("endpoint").getValue(); String existingEndpointNameSpace = (String) existingEndPoint.getValue().getAttribute("targetNamespace").getValue(); EnumDetails existingType = (EnumDetails) existingEndPoint.getValue().getAttribute("binding").getValue(); new NestedAnnotationAttributeValue(new JavaSymbolName("value"), getWsClientAnnotation(existingEndpointName, existingEndpointNameSpace, existingType).build()); new NestedAnnotationAttributeValue(new JavaSymbolName("value"), getWsClientAnnotation(endPoint, targetNameSpace, bindingType).build()); endpoints.add(newEndpoint); new NestedAnnotationAttributeValue(new JavaSymbolName("value"), getWsClientAnnotation( endPoint, targetNameSpace, bindingType).build()); endpoints.add(newEndpoint); new NestedAnnotationAttributeValue(new JavaSymbolName("value"), getWsClientAnnotation( endPoint, targetNameSpace, bindingType).build()); endpoints.add(newEndpoint);
/** * Gets attributo of a nested annotation attribute value * * @param newstedAnnotationAttr * @param attributeName * @return */ private <T> T getNestedAttributeValue(NestedAnnotationAttributeValue newstedAnnotationAttr, String attributeName) { AnnotationMetadata annotationValue = newstedAnnotationAttr.getValue(); if (annotationValue == null) { return null; } AnnotationAttributeValue<?> attribute = annotationValue.getAttribute(attributeName); if (attribute == null) { return null; } return (T) attribute.getValue(); }
new ArrayList<AnnotationAttributeValue<?>>(); for (AnnotationMetadataBuilder joinColumnAnnotation : joinColumnsBuilders) { joinColumnsAnnotations.add(new NestedAnnotationAttributeValue(new JavaSymbolName( "joinColumns"), joinColumnAnnotation.build())); new ArrayList<AnnotationAttributeValue<?>>(); for (AnnotationMetadataBuilder inverseJoinColumnsAnnotation : inverseJoinColumnsBuilders) { inverseJoinColumnsAnnotations.add(new NestedAnnotationAttributeValue(new JavaSymbolName( "inverseJoinColumns"), inverseJoinColumnsAnnotation.build())); new ArrayList<AnnotationAttributeValue<?>>(); for (AnnotationMetadataBuilder joinColumnAnnotation : joinColumnsBuilders) { joinColumnsAnnotations.add(new NestedAnnotationAttributeValue( new JavaSymbolName("value"), joinColumnAnnotation.build()));
@Override public String toString() { return getName() + " -> " + value.toString(); } }
if (finder.getValue() != null && finder.getValue().getAttribute("value") != null) { if (finder.getValue().getAttribute("value").getValue().equals(finderName.getSymbolName())) { LOGGER.log( Level.WARNING, new NestedAnnotationAttributeValue(new JavaSymbolName("value"), singleFinderAnnotation.build());
(String) authorizationAnnotation.getValue().getAttribute("method").getValue(); List<?> annotationParameters = (List<?>) authorizationAnnotation.getValue().getAttribute("parameters").getValue(); (NestedAnnotationAttributeValue) iterParamTypes.next(); String annotationMethodToAdd = (String) rooSecurityAuthorizationToAdd.getValue().getAttribute("method").getValue(); List<?> annotationParametersToAdd = (List<?>) rooSecurityAuthorizationToAdd.getValue().getAttribute("parameters").getValue();
final AnnotationExpr annotationExpr = (AnnotationExpr) expression; final AnnotationMetadata value = getInstance(annotationExpr, compilationUnitServices).build(); return new NestedAnnotationAttributeValue(annotationName, value);
(String) filterAnnotation.getValue().getAttribute("method").getValue(); List<?> annotationParameters = (List<?>) filterAnnotation.getValue().getAttribute("parameters").getValue(); String annotationWhen = (String) filterAnnotation.getValue().getAttribute("when").getValue(); (NestedAnnotationAttributeValue) iterParamTypes.next(); String annotationMethodToAdd = (String) rooSecurityFilterToAdd.getValue().getAttribute("method").getValue(); List<?> annotationParametersToAdd = (List<?>) rooSecurityFilterToAdd.getValue().getAttribute("parameters").getValue(); String annotationWhenToAdd = (String) rooSecurityFilterToAdd.getValue().getAttribute("when").getValue();
new NestedAnnotationAttributeValue(new JavaSymbolName("value"), getRooSecurityAuthorizationsAnnotation(method.getMethodName().getSymbolName(), lstParamTypes, roles, usernames).build());
(NestedAnnotationAttributeValue) valuesIt.next(); if (wsClientAnnotation.getValue() != null && wsClientAnnotation.getValue().getAttribute("endpoint") != null) { if (wsClientAnnotation.getValue().getAttribute("endpoint").getValue() instanceof String) { endpointName = (String) wsClientAnnotation.getValue().getAttribute("endpoint").getValue(); if (wsClientAnnotation.getValue().getAttribute("targetNamespace").getValue() instanceof String) { endpointNameSpace = (String) wsClientAnnotation.getValue().getAttribute("targetNamespace").getValue(); if (wsClientAnnotation.getValue().getAttribute("binding").getValue() instanceof EnumDetails) { endpointBindingType = (EnumDetails) wsClientAnnotation.getValue().getAttribute("binding").getValue();
new NestedAnnotationAttributeValue(new JavaSymbolName("value"), getRooSecurityFilterAnnotation(method.getMethodName().getSymbolName(), lstParamTypes, roles, usernames, when).build());
String methodName = (String) filterAnnotation.getValue().getAttribute("method").getValue(); String when = (String) filterAnnotation.getValue().getAttribute("when").getValue(); List<?> methodParameters = (List<?>) filterAnnotation.getValue().getAttribute("parameters").getValue(); if (filterAnnotation.getValue().getAttribute("roles") != null) { roles = (String) filterAnnotation.getValue().getAttribute("roles").getValue(); if (filterAnnotation.getValue().getAttribute("usernames") != null) { usernames = (String) filterAnnotation.getValue().getAttribute("usernames").getValue();
new JavaSymbolName("Placement.DEFAULT")); NestedAnnotationAttributeValue newDocumentation1 = new NestedAnnotationAttributeValue(new JavaSymbolName("value"), documentationAnnotation1.build()); documentations.add(newDocumentation1); new JavaSymbolName("Placement.PORT_TYPE_OPERATION_OUTPUT")); NestedAnnotationAttributeValue newDocumentation2 = new NestedAnnotationAttributeValue(new JavaSymbolName("value"), documentationAnnotation2.build()); documentations.add(newDocumentation2);
(String) authorizationAnnotation.getValue().getAttribute("method").getValue(); List<?> methodParameters = (List<?>) authorizationAnnotation.getValue().getAttribute("parameters").getValue(); if (authorizationAnnotation.getValue().getAttribute("roles") != null) { roles = (String) authorizationAnnotation.getValue().getAttribute("roles").getValue(); if (authorizationAnnotation.getValue().getAttribute("usernames") != null) { usernames = (String) authorizationAnnotation.getValue().getAttribute("usernames").getValue();
private AnnotationMetadataBuilder getJoinColumnsAnnotation( final Set<Reference> references, final JavaType fieldType) { final List<NestedAnnotationAttributeValue> arrayValues = new ArrayList<NestedAnnotationAttributeValue>(); // Nullable attribute will have same value for each // If some column not required, all JoinColumn will be nullable boolean nullable = false; for (final Reference reference : references) { if (!reference.getLocalColumn().isRequired()) { nullable = true; } } for (final Reference reference : references) { final AnnotationMetadataBuilder joinColumnAnnotation = getJoinColumnAnnotation( reference, true, fieldType, nullable); arrayValues.add(new NestedAnnotationAttributeValue( new JavaSymbolName(VALUE), joinColumnAnnotation.build())); } final List<AnnotationAttributeValue<?>> attributes = new ArrayList<AnnotationAttributeValue<?>>(); attributes.add(new ArrayAttributeValue<NestedAnnotationAttributeValue>( new JavaSymbolName(VALUE), arrayValues)); return new AnnotationMetadataBuilder(JOIN_COLUMNS, attributes); }