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

How to use
toFirstUpper
method
in
sirius.kernel.commons.Reflection

Best Java code snippets using sirius.kernel.commons.Reflection.toFirstUpper (Showing top 4 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: com.scireum/sirius-search

private boolean hasSetter(Field field) {
  try {
    field.getDeclaringClass().getMethod("set" + Reflection.toFirstUpper(field.getName()), field.getType());
    return true;
  } catch (NoSuchMethodException e) {
    Exceptions.ignore(e);
    return false;
  }
}
origin: com.scireum/sirius-kernel

private static Method getterAsIs(@Nonnull Class<?> clazz, @Nonnull String property) throws NoSuchMethodException {
  try {
    return clazz.getMethod("is" + toFirstUpper(property));
  } catch (NoSuchMethodException ex) {
    Exceptions.ignore(ex);
    return clazz.getMethod(property);
  }
}
origin: com.scireum/sirius-kernel

/**
 * Returns the setter method according to the java beans specification for a
 * given property.
 *
 * @param clazz     the class in which the method should be searched
 * @param property  the name of the property for which the setter is requested
 * @param fieldType determines the type of the field (which is accepted as parameter of the setter)
 * @return the <tt>Method</tt> which is used to get the value
 * @throws IllegalArgumentException if the setter cannot be obtained
 */
public static Method setter(Class<?> clazz, String property, Class<?> fieldType) {
  try {
    return clazz.getMethod("set" + toFirstUpper(property), fieldType);
  } catch (Exception e) {
    throw new IllegalArgumentException(Strings.apply("set-Method for Field %s not found: %s",
                             property,
                             e.getMessage()), e);
  }
}
origin: com.scireum/sirius-kernel

/**
 * Returns the getter method according to the java beans specification for a
 * given property.
 *
 * @param clazz    the class in which the method should be searched
 * @param property the name of the property for which the getter is requested
 * @return the <tt>Method</tt> which is used to get the value
 * @throws IllegalArgumentException if the getter cannot be obtained
 */
@Nonnull
@SuppressWarnings("squid:S1141")
@Explain("A nested catch block seems to be the most readable solution here")
public static Method getter(@Nonnull Class<?> clazz, @Nonnull String property) {
  try {
    try {
      return clazz.getMethod("get" + toFirstUpper(property));
    } catch (NoSuchMethodException e) {
      Exceptions.ignore(e);
      return getterAsIs(clazz, property);
    }
  } catch (Exception e) {
    throw new IllegalArgumentException(Strings.apply("get-Method for Field %s not found: %s",
                             property,
                             e.getMessage()), e);
  }
}
sirius.kernel.commonsReflectiontoFirstUpper

Javadoc

Converts the first character of a given string to upper case.

Comes in handy when translating properties to getter/setter names.

Popular methods of Reflection

  • evalAccessPath
    Evaluates the given access path (dot separated getters) and returns the result. An access path can
  • getter
    Returns the getter method according to the java beans specification for a given property.
  • getterAsIs
  • walkHierarchy
    Calls the given handler for each superclass of the given one. Calls the handler for the given class

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • onCreateOptionsMenu (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JTextField (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
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