Tabnine Logo
Reflection
Code IndexAdd Tabnine to your IDE (free)

How to use
Reflection
in
org.granite.messaging.reflect

Best Java code snippets using org.granite.messaging.reflect.Reflection (Showing top 20 results out of 315)

origin: org.graniteds/granite-client

public List<Property> getProperties(Class<?> entityClass) {
  return reflection.findSerializableProperties(entityClass);
}
 
origin: org.graniteds/granite-server

@SuppressWarnings("unchecked")
public <T> T newInstance(String className)
  throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException,
  InvocationTargetException, SecurityException {
  
  return newInstance((Class<T>)loadClass(className));
}
 
origin: org.graniteds/granite-client-javafx

public Platform(ClassLoader reflectionClassLoader) {
  this(new Reflection(reflectionClassLoader));
}
 
origin: org.graniteds/granite-client-javafx

@Override
public ClassDescriptor getClassDescriptor(String className) throws ClassNotFoundException {
  ClassDescriptor desc = classDescriptors.get(className);
  if (desc == null) {
    Class<?> cls = context.getReflection().loadClass(className);
    desc = context.getReflection().getDescriptor(cls);
    classDescriptors.put(className, desc);
  }
  return desc;
}
origin: org.graniteds/granite-client-javafx

  !field.isAnnotationPresent(Exclude.class)) {
  field.setAccessible(true);
  serializableProperties.add(reflection.newFieldProperty(field));
    continue;
  serializableProperties.add(reflection.newMethodProperty(method, null, name));
Collections.sort(serializableProperties, reflection.getLexicalPropertyComparator());
origin: org.graniteds/granite-client

protected List<Property> findSerializableDeclaredProperties(Class<?> cls) throws SecurityException {
  if (!isRegularClass(cls))
    throw new IllegalArgumentException("Not a regular class: " + cls);
    if ((modifiers & STATIC_TRANSIENT_MASK) == 0 && !field.isAnnotationPresent(Exclude.class)) {
      field.setAccessible(true);
      serializableProperties.add(newFieldProperty(field));
        continue;
      serializableProperties.add(newMethodProperty(method, null, name));
origin: org.graniteds/granite-server-hibernate4

public boolean canDecode(ExtendedObjectInput in, String className) throws ClassNotFoundException {
  Class<?> cls = in.getReflection().loadClass(className);
  return (cls.isAnnotationPresent(Entity.class) || cls.isAnnotationPresent(MappedSuperclass.class));
}
origin: org.graniteds/granite-client-javafx

      property = newMethodProperty(getter, method, name);
      break classLoop;
    property = newMethodProperty(method, setter, name);
    break classLoop;
for (Field field : c.getDeclaredFields()) {
  if ((field.getModifiers() & Modifier.STATIC) == 0 && field.isAnnotationPresent(annotationClass)) {
    property = newFieldProperty(field);
    break classLoop;
origin: org.graniteds/granite-client-javafx

protected Property getIdProperty(Class<?> entityClass, boolean throwIfNotFound) {
  checkEntity(entityClass);
  
  Property property = reflection.findProperty(entityClass, Id.class);
  if (property == null && throwIfNotFound)
    throw new PropertyNotFoundException("No property annotated with " + Id.class.getName() + " in " + entityClass);
  return property;
}
 
origin: org.graniteds/granite-client-java

public <T> Comparator<T> newComparator(ObjectInput in)
  throws ClassNotFoundException, InstantiationException, IllegalAccessException,
  InvocationTargetException, SecurityException, NoSuchMethodException {
  
  if (comparatorClassName == null)
    return null;
  
  return ((ExtendedObjectInput)in).getReflection().newInstance(comparatorClassName);
}
origin: org.graniteds/granite-server

public Class<?> loadClass(String className) throws ClassNotFoundException {
  return getClassLoader().loadClass(className);
}
 
origin: org.graniteds/granite-server

  property = NULL_PROPERTY;
else
  property = newFieldProperty(field);
origin: org.graniteds/granite-client

public void setPropertyValue(Object entity, String name, Object value) {
  Property property = reflection.findSerializableProperty(entity.getClass(), name);
  try {
    property.setObject(entity, value);
  }
  catch (Exception e) {
    throw new RuntimeException("Could not set " + property + " of object " + entity);
  }
}
 
origin: org.graniteds/granite-client-java

public ClassDescriptor getDescriptor(Class<?> cls) {
  if (cls == null || cls == Object.class || !isRegularClass(cls))
    return null;
  ClassDescriptor descriptor = descriptorCache.get(cls);
  if (descriptor == null) {
    descriptor = new ClassDescriptor(this, cls);
    ClassDescriptor previousDescriptor = descriptorCache.putIfAbsent(cls, descriptor);
    if (previousDescriptor != null)
      descriptor = previousDescriptor;
  }
  return descriptor;
}
 
origin: org.graniteds/granite-client-java

  !field.isAnnotationPresent(Exclude.class)) {
  field.setAccessible(true);
  serializableProperties.add(reflection.newFieldProperty(field));
    continue;
  serializableProperties.add(reflection.newMethodProperty(method, null, name));
Collections.sort(serializableProperties, reflection.getLexicalPropertyComparator());
origin: org.graniteds/granite-client-java

public boolean canDecode(ExtendedObjectInput in, String className) throws ClassNotFoundException {
  String alias = in.getAlias(className);
  Class<?> cls = in.getReflection().loadClass(alias);
  return cls.isAnnotationPresent(Entity.class);
}
origin: org.graniteds/granite-client-java

      property = newMethodProperty(getter, method, name);
      break classLoop;
    property = newMethodProperty(method, setter, name);
    break classLoop;
for (Field field : c.getDeclaredFields()) {
  if ((field.getModifiers() & Modifier.STATIC) == 0 && field.isAnnotationPresent(annotationClass)) {
    property = newFieldProperty(field);
    break classLoop;
origin: org.graniteds/granite-server

@Override
public ClassDescriptor getClassDescriptor(String className) throws ClassNotFoundException {
  ClassDescriptor desc = classDescriptors.get(className);
  if (desc == null) {
    Class<?> cls = context.getReflection().loadClass(className);
    desc = context.getReflection().getDescriptor(cls);
    classDescriptors.put(className, desc);
  }
  return desc;
}
origin: org.graniteds/granite-client-javafx

protected Property getVersionProperty(Class<?> entityClass, boolean throwIfNotFound) {
  checkEntity(entityClass);
  
  Property property = reflection.findProperty(entityClass, Version.class);
  if (property == null && throwIfNotFound)
    throw new PropertyNotFoundException("No property annotated with " + Version.class.getName() + " in " + entityClass);
  return property;
}
 
origin: org.graniteds/granite-server

public <T> Comparator<T> newComparator(ObjectInput in)
  throws ClassNotFoundException, InstantiationException, IllegalAccessException,
  InvocationTargetException, SecurityException, NoSuchMethodException {
  
  if (comparatorClassName == null)
    return null;
  
  return ((ExtendedObjectInput)in).getReflection().newInstance(comparatorClassName);
}
org.granite.messaging.reflectReflection

Javadoc

Reflection provider

Most used methods

  • findSerializableProperties
  • loadClass
  • newInstance
  • <init>
  • getClassLoader
  • isRegularClass
  • newFieldProperty
  • newMethodProperty
  • findProperty
  • findSerializableProperty
  • getDescriptor
  • getLexicalPropertyComparator
  • getDescriptor,
  • getLexicalPropertyComparator,
  • findSerializableDeclaredProperties

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • setScale (BigDecimal)
  • getSharedPreferences (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now