Exemplo n.º 1
0
 public EventPropertyGetterIndexed getGetterIndexed(String indexedProperty) {
   final EventPropertyGetterIndexed undIndexed =
       underlyingEventType.getGetterIndexed(indexedProperty);
   if (undIndexed != null) {
     return new EventPropertyGetterIndexed() {
       public Object get(EventBean theEvent, int index) throws PropertyAccessException {
         if (!(theEvent instanceof DecoratingEventBean)) {
           throw new PropertyAccessException("Mismatched property getter to EventBean type");
         }
         DecoratingEventBean wrapperEvent = (DecoratingEventBean) theEvent;
         EventBean wrappedEvent = wrapperEvent.getUnderlyingEvent();
         if (wrappedEvent == null) {
           return null;
         }
         return undIndexed.get(wrappedEvent, index);
       }
     };
   }
   final EventPropertyGetterIndexed decoIndexed =
       underlyingMapType.getGetterIndexed(indexedProperty);
   if (decoIndexed != null) {
     return new EventPropertyGetterIndexed() {
       public Object get(EventBean theEvent, int index) throws PropertyAccessException {
         if (!(theEvent instanceof DecoratingEventBean)) {
           throw new PropertyAccessException("Mismatched property getter to EventBean type");
         }
         DecoratingEventBean wrapperEvent = (DecoratingEventBean) theEvent;
         Map map = wrapperEvent.getDecoratingProperties();
         return decoIndexed.get(
             eventAdapterService.adapterForTypedMap(map, underlyingMapType), index);
       }
     };
   }
   return null;
 }