Class EntityModel

java.lang.Object
org.aksw.commons.beans.model.EntityModel
All Implemented Interfaces:
EntityOps

public class EntityModel extends Object implements EntityOps
  • Field Details

  • Constructor Details

  • Method Details

    • getConversionService

      public ConversionService getConversionService()
    • setConversionService

      public void setConversionService(ConversionService conversionService)
    • getAnnotationFinder

      public Function<Class<?>,Object> getAnnotationFinder()
    • setAnnotationFinder

      public void setAnnotationFinder(Function<Class<?>,Object> annotationFinder)
    • isInstantiable

      public boolean isInstantiable()
      Specified by:
      isInstantiable in interface EntityOps
    • newInstance

      public Object newInstance()
      Specified by:
      newInstance in interface EntityOps
    • isClonable

      public boolean isClonable()
      Specified by:
      isClonable in interface EntityOps
    • clone

      public Object clone(Object o)
      Specified by:
      clone in interface EntityOps
    • getClone

      public Function<Object,?> getClone()
    • setClone

      public void setClone(Function<Object,?> clone)
    • getPropertyOps

      public Map<String, PropertyModel> getPropertyOps()
    • getNewInstance

      public Supplier<?> getNewInstance()
    • setNewInstance

      public void setNewInstance(Supplier<?> newInstance)
    • setPropertyOps

      public void setPropertyOps(Map<String, PropertyModel> propertyOps)
    • tryGetCtor

      public static Constructor<?> tryGetCtor(Class<?> clazz, Class<?>... args)
    • getAllPropertyDescriptors

      public static Collection<PropertyDescriptor> getAllPropertyDescriptors(Class<?> clazz)
    • getAllInvolvedClasses

      public static Set<Class<?>> getAllInvolvedClasses(Class<?> clazz)
    • createDefaultModel

      public static EntityModel createDefaultModel(Class<?> clazz, ConversionService conversionService)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProperties

      public Collection<? extends PropertyModel> getProperties()
      Specified by:
      getProperties in interface EntityOps
    • getProperty

      public PropertyModel getProperty(String name)
      Specified by:
      getProperty in interface EntityOps
    • setAssociatedClass

      public void setAssociatedClass(Class<?> associatedClass)
    • getAssociatedClass

      public Class<?> getAssociatedClass()
      Specified by:
      getAssociatedClass in interface EntityOps
    • findAnnotation

      public <A> A findAnnotation(Class<A> annotationClass)
      Specified by:
      findAnnotation in interface EntityOps
    • getOps

      public <T> T getOps(Class<T> opsClass)
      Description copied from interface: EntityOps
      Operations may be associated with an entity. For example, an entity may support map operations (put, get, etc...) While such an entity may e.g. have a (read-only) size property, the get / put operations would be part of separate operations class associate with this entityOps instance.
      Specified by:
      getOps in interface EntityOps
    • isPrimitive

      public boolean isPrimitive()
      Specified by:
      isPrimitive in interface EntityOps
    • setPrimitive

      public void setPrimitive(boolean isSimple)
    • isCollection

      public boolean isCollection()
      Description copied from interface: EntityOps
      Entities may be container for items One issue is the identity of the items: E.g. a map is a collection of entry objects, but the getEntries method may create a copy of the entry objects. So if we cloned a collection, we would also have to clone the entry objects - even thought they are only temporary.
      Specified by:
      isCollection in interface EntityOps
    • setCollectionOps

      public void setCollectionOps(CollectionOps collectionOps)
    • getCollectionOps

      public CollectionOps getCollectionOps()
    • getItems

      public Iterator<?> getItems(Object entity)
      Specified by:
      getItems in interface EntityOps
    • setItems

      public void setItems(Object entity, Iterator<?> items)
      Specified by:
      setItems in interface EntityOps