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

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

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

origin: biz.aQute/bnd

result.add(convert(componentType, i));
origin: biz.aQute.bnd/biz.aQute.bndlib

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

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/bndlib

result.add(convert(componentType, i));
result.put(convert(keyType, entry.getKey()), convert(valueType, entry.getValue()));
origin: biz.aQute.bnd/biz.aQute.bndlib

result.add(convert(componentType, i));
result.put(convert(keyType, entry.getKey()), convert(valueType, entry.getValue()));
origin: biz.aQute/bndlib

result.add(convert(componentType, i));
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);
}
origin: biz.aQute.bnd/biz.aQute.bnd.annotation

@Override
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

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) {
    if (method.getReturnType().isPrimitive()
        || Number.class.isAssignableFrom(method.getReturnType())) {
      o = "0";
    } else
      return null;
  }
  return convert(method.getGenericReturnType(), o);
}
origin: biz.aQute.bnd/biz.aQute.bnd

@Override
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/annotation

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/biz.aQute.bndlib

@Override
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/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 || rt == Boolean.class)
      return false;
    if (method.getReturnType().isPrimitive()) {
      o = "0";
    } else
      return null;
  }
  return convert(method.getGenericReturnType(), o);
}
origin: biz.aQute.bnd/biz.aQute.bnd.annotation

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/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/annotation

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/bndlib

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

Object convertArray(Type componentType, Object o) throws Exception {
  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/bndlib

Object convertArray(Type componentType, Object o) throws Exception {
  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;
}
aQute.bnd.annotation.metatypeConfigurable$ConfigurableHandlerconvert

Popular methods of Configurable$ConfigurableHandler

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

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • setScale (BigDecimal)
  • getExternalFilesDir (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top Vim plugins
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