public List<MemberHoldingTypeDetails> matches( final List<MemberHoldingTypeDetails> memberHoldingTypeDetailsList) { final Map<String, MemberHoldingTypeDetails> matched = new HashMap<String, MemberHoldingTypeDetails>(); for (final MemberHoldingTypeDetails memberHoldingTypeDetails : memberHoldingTypeDetailsList) { for (final AnnotationMetadata annotationMetadata : memberHoldingTypeDetails.getAnnotations()) { for (final JavaType annotationTypeToMatchOn : annotationTypesToMatchOn) { if (annotationMetadata.getAnnotationType().equals(annotationTypeToMatchOn)) { matched.put(memberHoldingTypeDetails.getDeclaredByMetadataId(), memberHoldingTypeDetails); } } } } return new ArrayList<MemberHoldingTypeDetails>(matched.values()); } }
public boolean isRequestingAnnotatedWith(final AnnotationMetadata annotationMetadata, final String requestingMid) { for (final MemberHoldingTypeDetails memberHoldingTypeDetails : details) { if (MemberFindingUtils.getAnnotationOfType(memberHoldingTypeDetails.getAnnotations(), annotationMetadata.getAnnotationType()) != null) { if (memberHoldingTypeDetails.getDeclaredByMetadataId().equals(requestingMid)) { return true; } } } return false; } }
/** * Returns the metadata for the annotation of the given type from within the * given metadata * * @param metadata the metadata to search; can be <code>null</code> * @param annotationType the type of annotation for which to return the * metadata; can be <code>null</code> * @return <code>null</code> if not found * @since 1.2.0 */ public static AnnotationMetadata getAnnotationOfType( final MemberHoldingTypeDetailsMetadataItem<?> metadata, final JavaType annotationType) { if (metadata == null || metadata.getMemberHoldingTypeDetails() == null) { return null; } return getAnnotationOfType(metadata.getMemberHoldingTypeDetails().getAnnotations(), annotationType); }
for (final AnnotationMetadata annotationMetadata : cid.getAnnotations()) { if (!annotationToMidMap.containsKey(annotationMetadata.getAnnotationType())) { annotationToMidMap.put(annotationMetadata.getAnnotationType(), new HashSet<String>());
@Override public Object getTagValue(final MemberHoldingTypeDetails type) { final AnnotationMetadata layerAnnotation = MemberFindingUtils.getAnnotationOfType(type.getAnnotations(), layerAnnotationType); if (layerAnnotation == null || layerAnnotation.getAttribute(domainTypesAttribute) == null) { return null; } final AnnotationAttributeValue<?> value = layerAnnotation.getAttribute(domainTypesAttribute); final List<JavaType> domainTypes = new ArrayList<JavaType>(); if (value instanceof ClassAttributeValue) { domainTypes.add(((ClassAttributeValue) value).getValue()); } else if (value instanceof ArrayAttributeValue<?>) { final ArrayAttributeValue<?> castValue = (ArrayAttributeValue<?>) value; for (final AnnotationAttributeValue<?> val : castValue.getValue()) { if (val instanceof ClassAttributeValue) { domainTypes.add(((ClassAttributeValue) val).getValue()); } } } return domainTypes; } }
List<AnnotationMetadata> allDeclaredAnnotations = memberHoldingTypeDetails.getAnnotations(); for (AnnotationMetadata annotation : allDeclaredAnnotations) {
public List<MemberHoldingTypeDetails> matches( final List<MemberHoldingTypeDetails> memberHoldingTypeDetailsList) { final Map<String, MemberHoldingTypeDetails> matched = new HashMap<String, MemberHoldingTypeDetails>(); for (final MemberHoldingTypeDetails memberHoldingTypeDetails : memberHoldingTypeDetailsList) { for (final AnnotationMetadata annotationMetadata : memberHoldingTypeDetails.getAnnotations()) { for (final JavaType annotationTypeToMatchOn : annotationTypesToMatchOn) { if (annotationMetadata.getAnnotationType().equals(annotationTypeToMatchOn)) { matched.put(memberHoldingTypeDetails.getDeclaredByMetadataId(), memberHoldingTypeDetails); } } } } return new ArrayList<MemberHoldingTypeDetails>(matched.values()); } }
public boolean isRequestingAnnotatedWith(final AnnotationMetadata annotationMetadata, final String requestingMid) { for (final MemberHoldingTypeDetails memberHoldingTypeDetails : details) { if (MemberFindingUtils.getAnnotationOfType(memberHoldingTypeDetails.getAnnotations(), annotationMetadata.getAnnotationType()) != null) { if (memberHoldingTypeDetails.getDeclaredByMetadataId().equals(requestingMid)) { return true; } } } return false; } }
for (final AnnotationMetadata annotationMetadata : cid.getAnnotations()) { if (!annotationToMidMap.containsKey(annotationMetadata.getAnnotationType())) { annotationToMidMap.put(annotationMetadata.getAnnotationType(), new HashSet<String>());
/** * Returns the metadata for the annotation of the given type from within the * given metadata * * @param metadata the metadata to search; can be <code>null</code> * @param annotationType the type of annotation for which to return the * metadata; can be <code>null</code> * @return <code>null</code> if not found * @since 1.2.0 */ public static AnnotationMetadata getAnnotationOfType( final MemberHoldingTypeDetailsMetadataItem<?> metadata, final JavaType annotationType) { if (metadata == null || metadata.getMemberHoldingTypeDetails() == null) { return null; } return getAnnotationOfType(metadata.getMemberHoldingTypeDetails().getAnnotations(), annotationType); }
@Override public Object getTagValue(final MemberHoldingTypeDetails type) { final AnnotationMetadata layerAnnotation = MemberFindingUtils.getAnnotationOfType(type.getAnnotations(), layerAnnotationType); if (layerAnnotation == null || layerAnnotation.getAttribute(domainTypesAttribute) == null) { return null; } final AnnotationAttributeValue<?> value = layerAnnotation.getAttribute(domainTypesAttribute); final List<JavaType> domainTypes = new ArrayList<JavaType>(); if (value instanceof ClassAttributeValue) { domainTypes.add(((ClassAttributeValue) value).getValue()); } else if (value instanceof ArrayAttributeValue<?>) { final ArrayAttributeValue<?> castValue = (ArrayAttributeValue<?>) value; for (final AnnotationAttributeValue<?> val : castValue.getValue()) { if (val instanceof ClassAttributeValue) { domainTypes.add(((ClassAttributeValue) val).getValue()); } } } return domainTypes; } }
if (MemberFindingUtils.getAnnotationOfType(mhtd.getAnnotations(), RooJavaType.ROO_WEB_FINDER) != null) {