Class DslHelper

java.lang.Object
com.blackbuild.klum.ast.runtime.internal.DslHelper

public class DslHelper extends Object
  • Field Details

    • FIELD_ANNOTATION

      public static final Class<com.blackbuild.klum.ast.Field> FIELD_ANNOTATION
  • Method Details

    • isDslType

      public static boolean isDslType(Type type)
    • requireDslType

      public static Type requireDslType(Type type)
    • isDslObject

      public static boolean isDslObject(Object object)
    • isBuilder

      public static boolean isBuilder(Object object)
    • getDslHierarchyOf

      public static List<Class<?>> getDslHierarchyOf(Class<?> type)
    • getFactoryOf

      public static <T> KlumFactory<T> getFactoryOf(Class<T> type)
    • getHierarchyOf

      public static List<Class<?>> getHierarchyOf(Class<?> type)
    • getElementTypeOfField

      public static Type getElementTypeOfField(Class<?> type, String name)
    • getElementType

      public static Type getElementType(Field field)
    • getElementType

      public static Type getElementType(Type type)
    • getElementNameForField

      public static String getElementNameForField(Class<?> type, String fieldName)
    • castTo

      public static <T> T castTo(Object object, Class<T> targetType)
    • getField

      public static Optional<Field> getField(Class<?> type, String name)
    • getCachedField

      public static Optional<org.codehaus.groovy.reflection.CachedField> getCachedField(Class<?> type, String name)
    • getFieldValue

      public static <T> T getFieldValue(Object container, String name)
    • getKlumFieldType

      public static com.blackbuild.klum.ast.FieldType getKlumFieldType(Field field)
    • getFieldAnnotation

      public static <T extends Annotation> T getFieldAnnotation(Class<?> type, String fieldName, Class<T> annotationType)
    • isClosure

      public static boolean isClosure(Class<?> type)
    • getOptionalFieldAnnotation

      public static <T extends Annotation> Optional<T> getOptionalFieldAnnotation(Class<?> type, String fieldName, Class<T> annotationType)
    • getMethod

      public static Optional<Method> getMethod(Class<?> type, String name, Class<?>... args)
    • getKeyField

      public static Optional<Field> getKeyField(Class<?> type)
    • isKeyed

      public static boolean isKeyed(Class<?> type)
    • requireKeyed

      public static <T> Class<T> requireKeyed(Class<T> type)
    • requireNotKeyed

      public static <T> Class<T> requireNotKeyed(Class<T> type)
    • getRwHierarchyOf

      public static List<Class<?>> getRwHierarchyOf(Class<?> rwType)
    • isInstantiable

      public static boolean isInstantiable(Class<?> type)
    • getMethodsAnnotatedWith

      public static Stream<Method> getMethodsAnnotatedWith(Class<?> type, Class<? extends Annotation> annotation)
    • getFieldsAnnotatedWith

      public static Stream<Field> getFieldsAnnotatedWith(Class<?> type, Class<? extends Annotation> annotation)
    • getVirtualSetter

      public static <T> Optional<Method> getVirtualSetter(Class<?> rwType, String methodName, Class<T> type)
    • getAttributeValue

      public static Object getAttributeValue(String name, Object instance)
    • getClassFromType

      public static Class<?> getClassFromType(Type type)
    • shortNameFor

      public static String shortNameFor(Class<?> type)
    • getBreadcrumbPath

      public static String getBreadcrumbPath(Object instance)
    • getModelPath

      public static String getModelPath(Object instance)
    • getModelAndBreadcrumbPath

      public static String getModelAndBreadcrumbPath(Object instance)
    • isOwner

      public static boolean isOwner(@NotNull @NotNull Field field)
    • isLink

      public static boolean isLink(@NotNull @NotNull Field field)
    • isOptionalLink

      public static boolean isOptionalLink(@NotNull @NotNull Field field)
    • isRelationship

      public static boolean isRelationship(@NotNull @NotNull Field field)
      Returns whether a schema field represents a direct or collection-valued DSL relationship.