@Test public void testResolveAttribute() { AttributeResolver ar = new AttributeResolver(); ELContext context = Mockito.mock(ELContext.class); Object name = ar.getValue(context, new MyResource(Map.of("name", "jarda")), "name"); assertThat(name, notNullValue()); assertThat(name, is("jarda")); }
@Override public Object getValue(ELContext context, Object base, Object property) { return getAttributed(base) .flatMap(attributed -> attributed.abacAttribute(String.valueOf(property))) .map(value -> { context.setPropertyResolved(true); return value; }) .orElse(null); }
AttributeResolver extends ELResolver { @Override public Object getValue(ELContext context, Object base, Object property) { return getAttributed(base) .flatMap(attributed -> attributed.abacAttribute(String.valueOf(property))) .map(value -> { context.setPropertyResolved(true); return value; }) .orElse(null); } }
AttributeResolver extends ELResolver { @Override public Object getValue(ELContext context, Object base, Object property) { return getAttributed(base) .flatMap(attributed -> attributed.abacAttribute(String.valueOf(property))) .map(value -> { context.setPropertyResolved(true); return value; }) .orElse(null); }  }
AttributeResolver extends ELResolver { @Override public Object getValue(ELContext context, Object base, Object property) { return getAttributed(base) .flatMap(attributed -> attributed.abacAttribute(String.valueOf(property))) .map(value -> { context.setPropertyResolved(true); return value; }) .orElse(null); }  @Override Class<?> getCommonPropertyType(ELContext context, Object base); @Override Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base); @Override Class<?> getType(ELContext context, Object base, Object property); @Override Object getValue(ELContext context, Object base, Object property); @Override boolean isReadOnly(ELContext context, Object base, Object property); @Override void setValue(ELContext context, Object base, Object property, Object value); }
AttributeResolver extends ELResolver { @Override public Object getValue(ELContext context, Object base, Object property) { return getAttributed(base) .flatMap(attributed -> attributed.abacAttribute(String.valueOf(property))) .map(value -> { context.setPropertyResolved(true); return value; }) .orElse(null); }  @Override Class<?> getCommonPropertyType(ELContext context, Object base); @Override Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base); @Override Class<?> getType(ELContext context, Object base, Object property); @Override Object getValue(ELContext context, Object base, Object property); @Override boolean isReadOnly(ELContext context, Object base, Object property); @Override void setValue(ELContext context, Object base, Object property, Object value);  }