Tabnine Logo
Configurable$ConfigurableHandler
Code IndexAdd Tabnine to your IDE (free)

How to use
Configurable$ConfigurableHandler
in
aQute.bnd.annotation.metatype

Best Java code snippets using aQute.bnd.annotation.metatype.Configurable$ConfigurableHandler (Showing top 20 results out of 315)

origin: biz.aQute/bnd

public static <T> T createConfigurable(Class<T> c, Map<?, ?> properties) {
  Object o = Proxy.newProxyInstance(c.getClassLoader(), new Class<?>[] { c },
      new ConfigurableHandler(properties, c.getClassLoader()));
  return c.cast(o);
}
origin: biz.aQute/bnd

Class<?> resultType = (Class<?>) pType.getRawType();
if (Collection.class.isAssignableFrom(resultType)) {
  Collection<?> input = toCollection(o);
  if (resultType.isInterface()) {
    if (resultType == Collection.class || resultType == List.class)
    result.add(convert(componentType, i));
origin: biz.aQute.bnd/biz.aQute.bnd

Object convertArray(Type componentType, Object o) throws Exception {
  if (o instanceof String) {
    String s = (String) o;
    if (componentType == Byte.class || componentType == byte.class)
      return s.getBytes(UTF_8);
    if (componentType == Character.class || componentType == char.class)
      return s.toCharArray();
  }
  Collection<?> input = toCollection(o);
  Class<?> componentClass = getRawClass(componentType);
  Object array = Array.newInstance(componentClass, input.size());
  int i = 0;
  for (Object next : input) {
    Array.set(array, i++, convert(componentType, next));
  }
  return array;
}
origin: biz.aQute.bnd/biz.aQute.bnd.annotation

public Object convert(Type type, Object o) throws Exception {
  if (type instanceof ParameterizedType) {
    ParameterizedType pType = (ParameterizedType) type;
    return convert(pType, o);
    return convertArray(gType.getGenericComponentType(), o);
    return convertArray(resultType.getComponentType(), o);
origin: biz.aQute.bnd/bnd

public Object convert(Type type, Object o) throws Exception {
  if (type instanceof ParameterizedType) {
    ParameterizedType pType = (ParameterizedType) type;
    return convert(pType, o);
    return convertArray(gType.getGenericComponentType(), o);
    return convertArray(resultType.getComponentType(), o);
origin: biz.aQute.bnd/biz.aQute.bndlib

public Object convert(Type type, Object o) throws Exception {
  if (type instanceof ParameterizedType) {
    ParameterizedType pType = (ParameterizedType) type;
    return convert(pType, o);
    return convertArray(gType.getGenericComponentType(), o);
    return convertArray(resultType.getComponentType(), o);
origin: biz.aQute.bnd/biz.aQute.bnd

public Object convert(Type type, Object o) throws Exception {
  if (type instanceof ParameterizedType) {
    ParameterizedType pType = (ParameterizedType) type;
    return convert(pType, o);
    return convertArray(gType.getGenericComponentType(), o);
    return convertArray(resultType.getComponentType(), o);
origin: biz.aQute.bnd/annotation

public Object convert(Type type, Object o) throws Exception {
  if (type instanceof ParameterizedType) {
    ParameterizedType pType = (ParameterizedType) type;
    return convert(pType, o);
    return convertArray(gType.getGenericComponentType(), o);
    return convertArray(resultType.getComponentType(), o);
origin: biz.aQute.bnd/bndlib

public Object convert(Type type, Object o) throws Exception {
  if (type instanceof ParameterizedType) {
    ParameterizedType pType = (ParameterizedType) type;
    return convert(pType, o);
    return convertArray(gType.getGenericComponentType(), o);
    return convertArray(resultType.getComponentType(), o);
origin: biz.aQute/bnd

if (type instanceof ParameterizedType) {
  ParameterizedType pType = (ParameterizedType) type;
  return convert(pType, o);
  return convertArray(gType.getGenericComponentType(), o);
  return convertArray(resultType.getComponentType(), o);
origin: biz.aQute/bndlib

public Object convert(Type type, Object o) throws Exception {
  if (type instanceof ParameterizedType) {
    ParameterizedType pType = (ParameterizedType) type;
    return convert(pType, o);
    return convertArray(gType.getGenericComponentType(), o);
    return convertArray(resultType.getComponentType(), o);
origin: biz.aQute.bnd/biz.aQute.bnd

Class<?> resultType = (Class<?>) pType.getRawType();
if (Collection.class.isAssignableFrom(resultType)) {
  Collection<?> input = toCollection(o);
  if (resultType.isInterface()) {
    if (resultType == Collection.class || resultType == List.class)
    result.add(convert(componentType, i));
  Map<?, ?> input = toMap(o);
  if (resultType.isInterface()) {
    if (resultType == SortedMap.class)
    result.put(convert(keyType, entry.getKey()), convert(valueType, entry.getValue()));
origin: biz.aQute.bnd/biz.aQute.bnd.annotation

Class<?> resultType = (Class<?>) pType.getRawType();
if (Collection.class.isAssignableFrom(resultType)) {
  Collection<?> input = toCollection(o);
  if (resultType.isInterface()) {
    if (resultType == Collection.class || resultType == List.class)
    result.add(convert(componentType, i));
  Map<?, ?> input = toMap(o);
  if (resultType.isInterface()) {
    if (resultType == SortedMap.class)
    result.put(convert(keyType, entry.getKey()), convert(valueType, entry.getValue()));
origin: biz.aQute.bnd/annotation

Class< ? > resultType = (Class< ? >) pType.getRawType();
if (Collection.class.isAssignableFrom(resultType)) {
  Collection< ? > input = toCollection(o);
  if (resultType.isInterface()) {
    if (resultType == Collection.class || resultType == List.class)
    result.add(convert(componentType, i));
  Map< ? , ? > input = toMap(o);
  if (resultType.isInterface()) {
    if (resultType == SortedMap.class)
    result.put(convert(keyType, entry.getKey()), convert(valueType, entry.getValue()));
origin: biz.aQute.bnd/bnd

Class< ? > resultType = (Class< ? >) pType.getRawType();
if (Collection.class.isAssignableFrom(resultType)) {
  Collection< ? > input = toCollection(o);
  if (resultType.isInterface()) {
    if (resultType == Collection.class || resultType == List.class)
    result.add(convert(componentType, i));
  Map< ? , ? > input = toMap(o);
  if (resultType.isInterface()) {
    if (resultType == SortedMap.class)
    result.put(convert(keyType, entry.getKey()), convert(valueType, entry.getValue()));
origin: biz.aQute.bnd/bndlib

Class< ? > resultType = (Class< ? >) pType.getRawType();
if (Collection.class.isAssignableFrom(resultType)) {
  Collection< ? > input = toCollection(o);
  if (resultType.isInterface()) {
    if (resultType == Collection.class || resultType == List.class)
    result.add(convert(componentType, i));
  Map< ? , ? > input = toMap(o);
  if (resultType.isInterface()) {
    if (resultType == SortedMap.class)
    result.put(convert(keyType, entry.getKey()), convert(valueType, entry.getValue()));
origin: biz.aQute/bndlib

Class< ? > resultType = (Class< ? >) pType.getRawType();
if (Collection.class.isAssignableFrom(resultType)) {
  Collection< ? > input = toCollection(o);
  if (resultType.isInterface()) {
    if (resultType == Collection.class || resultType == List.class)
    result.add(convert(componentType, i));
  Map< ? , ? > input = toMap(o);
  if (resultType.isInterface()) {
    if (resultType == SortedMap.class)
    result.put(convert(keyType, entry.getKey()), convert(valueType, entry.getValue()));
origin: biz.aQute.bnd/biz.aQute.bndlib

Class<?> resultType = (Class<?>) pType.getRawType();
if (Collection.class.isAssignableFrom(resultType)) {
  Collection<?> input = toCollection(o);
  if (resultType.isInterface()) {
    if (resultType == Collection.class || resultType == List.class)
    result.add(convert(componentType, i));
  Map<?, ?> input = toMap(o);
  if (resultType.isInterface()) {
    if (resultType == SortedMap.class)
    result.put(convert(keyType, entry.getKey()), convert(valueType, entry.getValue()));
origin: biz.aQute.bnd/bnd

public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
  Meta.AD ad = method.getAnnotation(Meta.AD.class);
  String id = Configurable.mangleMethodName(method.getName());
  if (ad != null && !ad.id().equals(Meta.NULL))
    id = ad.id();
  Object o = properties.get(id);
  if (o == null) {
    if (ad != null) {
      if (ad.required())
        throw new IllegalStateException("Attribute is required but not set " + method.getName());
      o = ad.deflt();
      if (o.equals(Meta.NULL))
        o = null;
    }
  }
  if (o == null) {
    Class< ? > rt = method.getReturnType();
    if (rt == boolean.class )
      return false;
    
    if (method.getReturnType().isPrimitive()) {
      o = "0";
    } else
      return null;
  }
  return convert(method.getGenericReturnType(), o);
}
origin: biz.aQute.bnd/bndlib

public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
  Meta.AD ad = method.getAnnotation(Meta.AD.class);
  String id = Configurable.mangleMethodName(method.getName());
  if (ad != null && !ad.id().equals(Meta.NULL))
    id = ad.id();
  Object o = properties.get(id);
  if (o == null) {
    if (ad != null) {
      if (ad.required())
        throw new IllegalStateException("Attribute is required but not set " + method.getName());
      o = ad.deflt();
      if (o.equals(Meta.NULL))
        o = null;
    }
  }
  if (o == null) {
    Class< ? > rt = method.getReturnType();
    if (rt == boolean.class )
      return false;
    
    if (method.getReturnType().isPrimitive()) {
      o = "0";
    } else
      return null;
  }
  return convert(method.getGenericReturnType(), o);
}
aQute.bnd.annotation.metatypeConfigurable$ConfigurableHandler

Most used methods

  • <init>
  • convert
  • convertArray
  • getRawClass
  • toCollection
  • toMap

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 12 Jupyter Notebook extensions
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