Codota Logo
org.azeckoski.reflectutils
Code IndexAdd Codota to your IDE (free)

How to use org.azeckoski.reflectutils

Best Java code snippets using org.azeckoski.reflectutils (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: openmrs/openmrs-core

/**
 * This method returns true if the given annotation is present on the given field.
 * 
 * @param fieldClass
 * @param fieldName
 * @param annotation
 * @return true if the given annotation is present
 */
public static boolean isAnnotationPresent(Class<?> fieldClass, String fieldName, Class<? extends Annotation> annotation) {
  ClassFields<?> classFields = ClassDataCacher.getInstance().getClassFields(fieldClass);
  try {
    return classFields.getFieldAnnotation(annotation, fieldName) != null;
  } catch (FieldnameNotFoundException e) {
    return false;
  }
}

origin: openmrs/openmrs-core

/**
 * This method return all the fields (including private) from the given class and its super
 * classes.
 * 
 * @param fieldClass Class
 * @return List&lt;Field&gt;
 * @should return all fields include private and super classes
 */
public static List<Field> getAllFields(Class<?> fieldClass) {
  List<Field> fields = ClassDataCacher.getInstance().getClassData(fieldClass).getFields();
  return new ArrayList<>(fields);
}

origin: org.azeckoski/reflectutils

/**
 * Get the names of all fields in a class
 * @param cls any class
 * @return a list of the field names
 */
public <T> List<String> getFieldNames(Class<T> cls) {
  ClassFields<T> cf = analyzeClass(cls);
  return cf.getFieldNames();
}
origin: org.azeckoski/reflectutils

/**
 * Get the types of the fields of a specific class type <br/>
 * returns the method names as fields (without the "get"/"is" part and camelCased)
 * @param type any class
 * @param filter (optional) indicates the fields to return the types for, can be null for defaults
 * @return a map of field name -> class type
 */
public Map<String, Class<?>> getFieldTypes(Class<?> type, FieldsFilter filter) {
  ClassFields<?> cf = analyzeClass(type, findFieldFindMode(filter));
  Map<String, Class<?>> types = cf.getFieldTypes(filter);
  return types;
}
origin: org.azeckoski/reflectutils

/**
 * Analyze a class and produce an object which contains information about it and its fields
 * @param <T>
 * @param cls any class
 * @return the ClassFields analysis object which contains the information about this object class
 * @throws IllegalArgumentException if class is null or primitive
 */
public <T> ClassFields<T> analyzeClass(Class<T> cls) {
  ClassFields<T> cf = getClassDataCacher().getClassFields(cls);
  return cf;
}
origin: org.azeckoski/reflectutils

  @Override
  public boolean isSettable() {
    boolean settable = false;
    if (getIndexSetter() != null || super.isSettable()) {
      settable = true;
    }
    return settable;
  }
}
origin: org.azeckoski/reflectutils

/**
 * Set the option to include the "class" field when reflecting over objects,
 * the default for this is false (do not include)
 * @param includeClassField if true then include the value from the "getClass()" method as "class" when encoding beans and maps
 */
public void setIncludeClassField(boolean includeClassField) {
  getClassDataCacher().setIncludeClassField(includeClassField);
}
origin: org.azeckoski/reflectutils

/**
 * Add a converter to the default set which will convert objects to the supplied type
 * @param type the type this converter will convert objects to
 * @param converter the converter
 */
public void addConverter(Class<?> type, Converter<?> converter) {
  getConversionUtils().addConverter(type, converter);
}
origin: org.azeckoski/reflectutils

/**
 * Get the type of a field from a class
 * @param type any class
 * @param fieldName the name of the field (property) or a getter method converted to a field name
 * @return the type of object stored in the field
 * @throws FieldnameNotFoundException if the fieldName could not be found in this object
 */
public Class<?> getFieldType(Class<?> type, String fieldName) {
  return getFieldUtils().getFieldType(type, fieldName);
}
origin: org.azeckoski/reflectutils

@Override
public boolean isGettable() {
  boolean gettable = false;
  if (getMapGetter() != null || super.isGettable()) {
    gettable = true;
  }
  return gettable;
}
@Override
origin: org.azeckoski/reflectutils

/**
 * Analyze a class and produce an object which contains information about it and its fields
 * @param <T>
 * @param beanClass any object class
 * @return the ClassFields analysis object which contains the information about this object class
 * @throws IllegalArgumentException if class is null or primitive
 */
public <T> ClassFields<T> analyzeClass(Class<T> beanClass) {
  return getFieldUtils().analyzeClass(beanClass);
}
origin: org.azeckoski/reflectutils

  @Override
  public boolean isSettable() {
    boolean settable = false;
    if (getMapSetter() != null || super.isSettable()) {
      settable = true;
    }
    return settable;
  }
}
origin: org.azeckoski/reflectutils

/**
 * Set the object converters to add to the default converters
 * @param converters a map of converters to add to the default set, null to just use the default set
 */
public void setConverters(Map<Class<?>, Converter<?>> converters) {
  getConversionUtils().setConverters(converters);
}
origin: org.azeckoski/reflectutils

/**
 * Set the field name path resolver to use
 * @param resolver the field path name resolver to use when resolving EL style paths, null for default
 * @see FieldUtils#setResolver(Resolver)
 */
public void setResolver(Resolver resolver) {
  getFieldUtils().setResolver(resolver);
}
origin: org.azeckoski/reflectutils

/**
 * Set the cache to be used for holding the reflection data, 
 * this allows control over where the reflection caches are stored,
 * this should store the data in a way that it will not hold open the classloader the class comes from <br/>
 * Note that you can set this to a map implementation which does not store anything to disable caching if you like
 * 
 * @param reflectionCache a cache for holding class cache data (implements map), null to use the default internal cache
 */
@SuppressWarnings("unchecked")
public void setReflectionCache(Map<Class<?>, ClassFields> reflectionCache) {
  getClassDataCacher().setReflectionCache(reflectionCache);
}
origin: org.azeckoski/reflectutils

@Override
public boolean isGettable() {
  boolean gettable = false;
  if (getIndexGetter() != null || super.isGettable()) {
    gettable = true;
  }
  return gettable;
}
@Override
origin: org.azeckoski/reflectutils

/**
 * Get the types of the fields of a specific class type,
 * returns the method names without the "get"/"is" part and camelCased
 * @param type any class
 * @param filter (optional) indicates the fields to return the types for, can be null for defaults
 * @return a map of field name -> class type
 */
@SuppressWarnings("SameParameterValue")
public Map<String, Class<?>> getFieldTypes(Class<?> type, FieldsFilter filter) {
  Map<String, Class<?>> types = getFieldUtils().getFieldTypes(type, filter);
  return types;
}
origin: azeckoski/reflectutils

/**
 * @param name the fieldName
 * @return the type of this field
 * @throws FieldnameNotFoundException if this fieldName is invalid
 */
public Class<?> getFieldType(String name) {
  ClassProperty cp = getAnyPropertyOrFail(name);
  Class<?> type = cp.getType();
  return type;
}
origin: azeckoski/reflectutils

/**
 * Get the types of the fields of a specific class type <br/>
 * returns the method names as fields (without the "get"/"is" part and camelCased)
 * @param type any class
 * @param filter (optional) indicates the fields to return the types for, can be null for defaults
 * @return a map of field name -> class type
 */
public Map<String, Class<?>> getFieldTypes(Class<?> type, FieldsFilter filter) {
  ClassFields<?> cf = analyzeClass(type, findFieldFindMode(filter));
  Map<String, Class<?>> types = cf.getFieldTypes(filter);
  return types;
}
origin: azeckoski/reflectutils

  @Override
  public boolean isSettable() {
    boolean settable = false;
    if (getIndexSetter() != null || super.isSettable()) {
      settable = true;
    }
    return settable;
  }
}
org.azeckoski.reflectutils

Most used classes

  • ReflectUtils
    Reflection utilities and utilities related to working with classes and their fields These are built
  • ClassFields
  • ConstructorUtils
    Class which provides methods for dealing with class constructors, also provides access to all the pu
  • XMLTranscoder
    Provides methods for encoding and decoding XML Note that the XML parser always trashes the root nod
  • ArrayUtils
    Utils for working with collections and arrays (these are basically convenience methods)
  • HTMLTranscoder,
  • JSONTranscoder,
  • ClassData,
  • ClassDataCacher,
  • ClassLoaderUtils,
  • ConversionUtils,
  • ReferenceMap,
  • Transcoder,
  • ClassData$MemberComparator,
  • ClassFields$FieldFindMode,
  • ClassFields$FieldsFilter,
  • ClassFields$GetClassMethodException,
  • ClassProperty$IndexedProperty,
  • ClassProperty$MappedProperty
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now