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

How to use
Reflection
in
cascading.lingual.util

Best Java code snippets using cascading.lingual.util.Reflection (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: cascading/lingual-core

public static <T> T invokeInstanceMethodSafe( Object target, String methodName, Object parameter, Class parameterType )
 {
 try
  {
  return invokeInstanceMethod( target, methodName, new Object[]{parameter}, new Class[]{parameterType} );
  }
 catch( Exception exception )
  {
  return null;
  }
 }
origin: cascading/lingual-core

public static Object invokeStaticMethod( ClassLoader loader, String typeString, String methodName, Object[] parameters, Class[] parameterTypes )
 {
 Class type = loadClass( loader, typeString );
 return invokeStaticMethod( type, methodName, parameters, parameterTypes );
 }
origin: cascading/lingual-core

public static Object newInstanceSafe( Class type )
 {
 if( type == null )
  return null;
 try
  {
  return newInstance( type );
  }
 catch( Exception exception )
  {
  return null;
  }
 }
origin: cascading/lingual-core

public static void setLogLevel( ClassLoader loader, String log, String level )
 {
 Object loggerObject = getLoggerObject( loader, log );
 Object levelObject = Reflection.invokeStaticMethod( loader, "org.apache.log4j.Level", "toLevel",
  new Object[]{level}, new Class[]{String.class} );
 Reflection.invokeInstanceMethod( loggerObject, "setLevel", levelObject, levelObject.getClass() );
 }
origin: cascading/lingual-platform

public TestProviderFactory()
 {
 String [] classNames = { "cascading.lingual.platform.local.LocalDefaultFactory",
              "cascading.lingual.platform.hadoop.HadoopDefaultFactory",
              "cascading.lingual.platform.hadoop2.Hadoop2MR1DefaultFactory",
              "cascading.lingual.platform.tez.TezDefaultFactory" };
 for( String className: classNames)
  {
  factory = (DefaultFactory) newInstanceSafe( loadClassSafe( className ) );
  if( factory != null )
   break;
  }
 if( factory == null )
  throw new IllegalStateException( "unable to load factory from known classes" );
 }
origin: cascading/lingual-core

private CatalogService loadCatalogServicePlugin()
 {
 // getServiceUtil is a private method, this allows for an impl to be loaded from an internal classloader
 ServiceLoader loader = Reflection.invokeInstanceMethod( getCascadingServices(), "getServiceUtil" );
 Properties defaultProperties = Reflection.getStaticField( getCascadingServices().getClass(), "defaultProperties" );
 return (CatalogService) loader.loadServiceFrom( defaultProperties, getProperties(), CatalogService.CATALOG_SERVICE_CLASS_PROPERTY );
 }
origin: cascading/lingual-core

public static Class<?> loadClassSafe( String typeString )
 {
 try
  {
  return loadClass( typeString );
  }
 catch( Exception exception )
  {
  return null;
  }
 }
origin: cascading/lingual-core

private static Object getLoggerObject( ClassLoader loader, String log )
 {
 if( log == null || log.isEmpty() )
  return Reflection.invokeStaticMethod( loader, "org.apache.log4j.Logger", "getRootLogger", null, null );
 return Reflection.invokeStaticMethod( loader, "org.apache.log4j.Logger", "getLogger",
  new Object[]{log}, new Class[]{String.class} );
 }
}
origin: cascading/lingual-core

public static Class<?> loadClass( ClassLoader loader, String typeString )
 {
 try
  {
  return loader.loadClass( typeString );
  }
 catch( ClassNotFoundException exception )
  {
  throw new CascadingException( "unable to load class: " + typeString, exception );
  }
 }
origin: cascading/lingual-core

public static <T> T invokeInstanceMethod( Object target, String methodName )
 {
 return invokeInstanceMethod( target, methodName, (Object[]) null, (Class[]) null );
 }
origin: cascading/lingual-core

private Class loadClass( String className, String jarPath )
 {
 LOG.debug( "loading: {} from: {}", className, jarPath );
 if( jarPath == null ) // its a default factory
  {
  classLoader = Thread.currentThread().getContextClassLoader();
  return Reflection.loadClass( classLoader, className );
  }
 String qualifiedPath = platformBroker.makePath( platformBroker.getFullProviderPath(), jarPath );
 try
  {
  return platformBroker.loadClass( qualifiedPath, className );
  }
 finally
  {
  try
   {
   classLoader = platformBroker.getUrlClassLoader( qualifiedPath );
   }
  catch( Exception exception )
   {
   // do nothing
   }
  }
 }
}
origin: cascading/lingual-core

public static <T> T invokeInstanceMethod( Object target, String methodName, Object parameter, Class parameterType )
 {
 return invokeInstanceMethod( target, methodName, new Object[]{parameter}, new Class[]{parameterType} );
 }
origin: cascading/lingual-core

public static String getLogLevel( ClassLoader loader, String log )
 {
 Object loggerObject = getLoggerObject( loader, log );
 Object level = Reflection.invokeInstanceMethod( loggerObject, "getLevel" );
 if( level == null )
  return "";
 return level.toString();
 }
cascading.lingual.utilReflection

Javadoc

Reflection is a reflection utility helper.

Most used methods

  • getStaticField
  • invokeInstanceMethod
  • invokeStaticMethod
  • loadClass
  • loadClassSafe
  • newInstance
  • newInstanceSafe

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
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