Class EntityPropertyAccessor

java.lang.Object
io.jmix.dynmodel.impl.EntityPropertyAccessor
All Implemented Interfaces:
org.springframework.expression.PropertyAccessor, org.springframework.expression.TargetedAccessor

@NullMarked public class EntityPropertyAccessor extends Object implements org.springframework.expression.PropertyAccessor
SpEL property accessor that exposes only Jmix metadata properties of entities. Writes are supported only when constructed as writable.
  • Field Details

    • metadata

      protected final Metadata metadata
    • writable

      protected final boolean writable
  • Constructor Details

    • EntityPropertyAccessor

      public EntityPropertyAccessor(Metadata metadata, boolean writable)
  • Method Details

    • getSpecificTargetClasses

      public Class<?>[] getSpecificTargetClasses()
      Specified by:
      getSpecificTargetClasses in interface org.springframework.expression.TargetedAccessor
    • canRead

      public boolean canRead(org.springframework.expression.EvaluationContext context, @Nullable Object target, String name)
      Specified by:
      canRead in interface org.springframework.expression.PropertyAccessor
    • read

      public org.springframework.expression.TypedValue read(org.springframework.expression.EvaluationContext context, @Nullable Object target, String name)
      Specified by:
      read in interface org.springframework.expression.PropertyAccessor
    • canWrite

      public boolean canWrite(org.springframework.expression.EvaluationContext context, @Nullable Object target, String name)
      Specified by:
      canWrite in interface org.springframework.expression.PropertyAccessor
    • write

      public void write(org.springframework.expression.EvaluationContext context, @Nullable Object target, String name, @Nullable Object newValue) throws org.springframework.expression.AccessException
      Specified by:
      write in interface org.springframework.expression.PropertyAccessor
      Throws:
      org.springframework.expression.AccessException
    • hasMetadataProperty

      protected boolean hasMetadataProperty(@Nullable Object target, String name)