Tabnine Logo
Class.getPackageName
Code IndexAdd Tabnine to your IDE (free)

How to use
getPackageName
method
in
java.lang.Class

Best Java code snippets using java.lang.Class.getPackageName (Showing top 4 results out of 315)

origin: opengeospatial/geoapi

  /**
   * Specifies how the Java methods in the given interface should be mapped to Python methods or attributes.
   * There is two main interfacing modes supported by default: if this method returns {@link Interfacing#GEOAPI},
   * then the mapping between Java and Python uses the following rules:
   *
   * <ul>
   *   <li>For any Java method, the name of the corresponding Python attribute is given
   *       by the {@link org.opengis.annotation.UML} annotation associated to the method.
   *       If a method has no such annotation, then its name is used as a fallback.</li>
   *   <li>GeoAPI-specific property types are supported ({@link org.opengis.util.CodeList}
   *       and {@link InternationalString}) in addition of some Java standard types like
   *       {@link Enum} and {@link java.util.Collection}.</li>
   * </ul>
   *
   * If this method returns {@link Interfacing#DEFAULT},
   * then the Python-Java mapping is delegated to the underlying JPY library.
   * If this method returns another value, then the behavior is defined by
   * {@link Interfacing#toJava(PyObject, Class)}.
   *
   * @param  type  the Java type for which to determine the interfacing mode.
   * @return a specification of how to interface Java methods to Python.
   */
  protected Interfacing getInterfacing(final Class<?> type) {
    return type.getPackageName().startsWith(Interfacing.GeoAPI.JAVA_PREFIX) ? Interfacing.GEOAPI : Interfacing.DEFAULT;
  }
}
origin: hibernate/hibernate-demos

  @Override
  protected Lookup computeValue(Class<?> type) {
    if ( !getClass().getModule().canRead( type.getModule() ) ) {
      getClass().getModule().addReads( type.getModule() );
    }
    packageOpener.openPackageIfNeeded(
        type.getModule(), type.getPackageName(), FieldValueReaderImpl.class.getModule()
    );
    try {
      return MethodHandles.privateLookupIn( type, MethodHandles.lookup() );
    }
    catch (IllegalAccessException e) {
      throw new RuntimeException( e );
    }
  }
};
origin: org.jooq/joor

if (className.startsWith(caller.getPackageName() + ".") &&
  Character.isUpperCase(className.charAt(caller.getPackageName().length() + 1))) {
  Lookup privateLookup = MethodHandles.privateLookupIn(caller, lookup);
  result = fileManager.loadAndReturnMainClass(className,
origin: elastic/apm-agent-java

@Test
void testMethodMatching() throws Exception {
  assertMatches(MethodMatcher.of(getClass().getName() + "#*"), getClass().getDeclaredMethod("testMethodMatching"));
  assertMatches(MethodMatcher.of(getClass().getName() + "#testMethodMatching"), getClass().getDeclaredMethod("testMethodMatching"));
  assertMatches(MethodMatcher.of(getClass().getName() + "#testMethodMatching()"), getClass().getDeclaredMethod("testMethodMatching"));
  assertMatches(MethodMatcher.of(getClass().getName() + "#testIntParameter"), getClass().getDeclaredMethod("testIntParameter", int.class));
  assertMatches(MethodMatcher.of("private " + getClass().getName() + "#testIntParameter"), getClass().getDeclaredMethod("testIntParameter", int.class));
  assertMatches(MethodMatcher.of("* " + getClass().getName() + "#testIntParameter"), getClass().getDeclaredMethod("testIntParameter", int.class));
  assertMatches(MethodMatcher.of(getClass().getName() + "#testIntParameter(int)"), getClass().getDeclaredMethod("testIntParameter", int.class));
  assertMatches(MethodMatcher.of(getClass().getName() + "#testStringParameter(java.lang.String)"), getClass().getDeclaredMethod("testStringParameter", String.class));
  assertMatches(MethodMatcher.of("protected " + getClass().getName() + "#testStringParameter(java.lang.String)"), getClass().getDeclaredMethod("testStringParameter", String.class));
  assertMatches(MethodMatcher.of("* " + getClass().getName() + "#testStringParameter(java.lang.String)"), getClass().getDeclaredMethod("testStringParameter", String.class));
  assertMatches(MethodMatcher.of(getClass().getName() + "#testMultipleParameters(java.lang.String, int[], java.lang.Object[])"), getClass().getDeclaredMethod("testMultipleParameters", String.class, int[].class, Object[].class));
  assertMatches(MethodMatcher.of(getClass().getName() + "#testMultipleParameters(*.String, int[], java.lang.Object[])"), getClass().getDeclaredMethod("testMultipleParameters", String.class, int[].class, Object[].class));
  assertMatches(MethodMatcher.of(getClass().getName() + "#testMultipleParameters(*, *, *)"), getClass().getDeclaredMethod("testMultipleParameters", String.class, int[].class, Object[].class));
  assertMatches(MethodMatcher.of(getClass().getPackageName() + "*#*"), getClass().getDeclaredMethod("testMethodMatching"));
  assertMatches(MethodMatcher.of(getClass().getPackageName() + "*"), getClass().getDeclaredMethod("testMethodMatching"));
}
java.langClassgetPackageName

Popular methods of Class

  • getName
    Returns the name of the class represented by this Class. For a description of the format which is us
  • getSimpleName
  • getClassLoader
  • isAssignableFrom
    Determines if the class or interface represented by this Class object is either the same as, or is a
  • forName
    Returns the Class object associated with the class or interface with the given string name, using th
  • newInstance
    Returns a new instance of the class represented by this Class, created by invoking the default (that
  • getMethod
    Returns a Method object that reflects the specified public member method of the class or interface r
  • getResourceAsStream
    Finds a resource with a given name. The rules for searching resources associated with a given class
  • getSuperclass
    Returns the Class representing the superclass of the entity (class, interface, primitive type or voi
  • getConstructor
  • cast
    Casts an object to the class or interface represented by this Class object.
  • isInstance
  • cast,
  • isInstance,
  • getCanonicalName,
  • getDeclaredField,
  • isArray,
  • getAnnotation,
  • getDeclaredFields,
  • getResource,
  • getDeclaredMethod,
  • getMethods

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JFileChooser (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • From CI to AI: The AI layer in your organization
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