コード例 #1
0
 @Override
 public void process(final ProcessMethodContext processMethodContext) {
   final Class<MemberOrder> annotationClass = MemberOrder.class;
   final MemberOrder annotation =
       Annotations.getAnnotation(processMethodContext.getMethod(), annotationClass);
   FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
 }
コード例 #2
0
 private static DescribedAsFacet createFromAnnotationIfPossible(
     final ProcessMethodContext processMethodContext) {
   // look for annotation on the property
   final DescribedAs annotation =
       Annotations.getAnnotation(processMethodContext.getMethod(), DescribedAs.class);
   return annotation == null
       ? null
       : new DescribedAsFacetOnMemberAnnotation(
           annotation.value(), processMethodContext.getFacetHolder());
 }
コード例 #3
0
 private MemberOrderFacet createFromAnnotationIfPossible(
     final ProcessMethodContext processMethodContext) {
   final MemberOrder annotation =
       Annotations.getAnnotation(processMethodContext.getMethod(), MemberOrder.class);
   if (annotation != null) {
     return new MemberOrderFacetAnnotation(
         annotation.name(),
         annotation.sequence(),
         servicesInjector.lookupService(TranslationService.class),
         processMethodContext.getFacetHolder());
   } else {
     return null;
   }
 }
 @Override
 public void processParams(final ProcessParameterContext processParameterContext) {
   final Annotation[] parameterAnnotations =
       Annotations.getParameterAnnotations(processParameterContext.getMethod())[
           processParameterContext.getParamNum()];
   for (final Annotation parameterAnnotation : parameterAnnotations) {
     if (parameterAnnotation instanceof RenderedAsDayBefore) {
       final RenderedAsDayBefore annotation = (RenderedAsDayBefore) parameterAnnotation;
       final RenderedAdjustedFacet facet =
           create(annotation, processParameterContext.getFacetHolder());
       FacetUtil.addFacet(validator.flagIfPresent(facet, processParameterContext));
       return;
     }
   }
 }
  @Override
  public void process(ProcessClassContext processClassContext) {
    final Class<?> cls = processClassContext.getCls();
    final PersistenceCapable annotation = Annotations.getAnnotation(cls, PersistenceCapable.class);
    if (annotation == null) {
      return;
    }
    String annotationTableAttribute = annotation.table();
    if (StringUtils.isNullOrEmpty(annotationTableAttribute)) {
      annotationTableAttribute = cls.getSimpleName();
    }

    final IdentityType annotationIdentityType = annotation.identityType();

    FacetUtil.addFacet(
        new JdoPersistenceCapableFacetAnnotation(
            annotationTableAttribute,
            annotationIdentityType,
            processClassContext.getFacetHolder()));
    return;
  }
コード例 #6
0
 @Override
 public void process(final ProcessClassContext processClassContaxt) {
   final FieldOrder annotation =
       Annotations.getAnnotation(processClassContaxt.getCls(), FieldOrder.class);
   FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
 }