congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Configurable
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: biz.aQute.bnd/biz.aQute.bndlib

public static <T> T createConfigurable(Class<T> c, Dictionary<?, ?> properties) {
  Map<Object, Object> alt = new HashMap<>();
  for (Enumeration<?> e = properties.keys(); e.hasMoreElements();) {
    Object key = e.nextElement();
    alt.put(key, properties.get(key));
  }
  return createConfigurable(c, alt);
}
origin: biz.aQute.bnd/bnd

private Collection< ? > toCollection(Object o) {
  if (o instanceof Collection)
    return (Collection< ? >) o;
  if (o.getClass().isArray()) {
    if (o.getClass().getComponentType().isPrimitive()) {
      int length = Array.getLength(o);
      List<Object> result = new ArrayList<Object>(length);
      for (int i = 0; i < length; i++) {
        result.add(Array.get(o, i));
      }
      return result;
    }
    return Arrays.asList((Object[]) o);
  }
  if (o instanceof String) {
    String s = (String) o;
    if (SPLITTER_P.matcher(s).find())
      return Arrays.asList(s.split("\\|"));
    else 
      return unescape(s);
    
  }
  return Arrays.asList(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.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 static <T> T createConfigurable(Class<T> c, Dictionary< ? , ? > properties) {
  Map<Object,Object> alt = new HashMap<Object,Object>();
  for (Enumeration< ? > e = properties.keys(); e.hasMoreElements();) {
    Object key = e.nextElement();
    alt.put(key, properties.get(key));
  }
  return createConfigurable(c, alt);
}
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/bndlib

private Collection< ? > toCollection(Object o) {
  if (o instanceof Collection)
    return (Collection< ? >) o;
  if (o.getClass().isArray()) {
    if (o.getClass().getComponentType().isPrimitive()) {
      int length = Array.getLength(o);
      List<Object> result = new ArrayList<Object>(length);
      for (int i = 0; i < length; i++) {
        result.add(Array.get(o, i));
      }
      return result;
    }
    return Arrays.asList((Object[]) o);
  }
  if (o instanceof String) {
    String s = (String) o;
    if (SPLITTER_P.matcher(s).find())
      return Arrays.asList(s.split("\\|"));
    else 
      return unescape(s);
    
  }
  return Arrays.asList(o);
}
origin: biz.aQute.bnd/bnd

public static <T> T createConfigurable(Class<T> c, Dictionary< ? , ? > properties) {
  Map<Object,Object> alt = new HashMap<Object,Object>();
  for (Enumeration< ? > e = properties.keys(); e.hasMoreElements();) {
    Object key = e.nextElement();
    alt.put(key, properties.get(key));
  }
  return createConfigurable(c, alt);
}
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/annotation

private Collection< ? > toCollection(Object o) {
  if (o instanceof Collection)
    return (Collection< ? >) o;
  if (o.getClass().isArray()) {
    if (o.getClass().getComponentType().isPrimitive()) {
      int length = Array.getLength(o);
      List<Object> result = new ArrayList<Object>(length);
      for (int i = 0; i < length; i++) {
        result.add(Array.get(o, i));
      }
      return result;
    }
    return Arrays.asList((Object[]) o);
  }
  if (o instanceof String) {
    String s = (String) o;
    if (SPLITTER_P.matcher(s).find())
      return Arrays.asList(s.split("\\|"));
    else 
      return unescape(s);
    
  }
  return Arrays.asList(o);
}
origin: biz.aQute/bnd

public static <T> T createConfigurable(Class<T> c, Dictionary<?, ?> properties) {
  Map<Object,Object> alt = new HashMap<Object,Object>();
  for( Enumeration<?> e = properties.keys(); e.hasMoreElements(); ) {
    Object key = e.nextElement();
    alt.put(key, properties.get(key));
  }
  return createConfigurable(c, alt);
}
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.bndlib

private Collection<?> toCollection(Object o) {
  if (o instanceof Collection)
    return (Collection<?>) o;
  if (o.getClass()
    .isArray()) {
    if (o.getClass()
      .getComponentType()
      .isPrimitive()) {
      int length = Array.getLength(o);
      List<Object> result = new ArrayList<>(length);
      for (int i = 0; i < length; i++) {
        result.add(Array.get(o, i));
      }
      return result;
    }
    return Arrays.asList((Object[]) o);
  }
  if (o instanceof String) {
    String s = (String) o;
    if (SPLITTER_P.matcher(s)
      .find())
      return Arrays.asList(s.split("\\|"));
    else
      return unescape(s);
  }
  return Arrays.asList(o);
}
origin: biz.aQute.bnd/annotation

public static <T> T createConfigurable(Class<T> c, Dictionary< ? , ? > properties) {
  Map<Object,Object> alt = new HashMap<Object,Object>();
  for (Enumeration< ? > e = properties.keys(); e.hasMoreElements();) {
    Object key = e.nextElement();
    alt.put(key, properties.get(key));
  }
  return createConfigurable(c, alt);
}
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.bnd.annotation

private Collection<?> toCollection(Object o) {
  if (o instanceof Collection)
    return (Collection<?>) o;
  if (o.getClass()
    .isArray()) {
    if (o.getClass()
      .getComponentType()
      .isPrimitive()) {
      int length = Array.getLength(o);
      List<Object> result = new ArrayList<>(length);
      for (int i = 0; i < length; i++) {
        result.add(Array.get(o, i));
      }
      return result;
    }
    return Arrays.asList((Object[]) o);
  }
  if (o instanceof String) {
    String s = (String) o;
    if (SPLITTER_P.matcher(s)
      .find())
      return Arrays.asList(s.split("\\|"));
    else
      return unescape(s);
  }
  return Arrays.asList(o);
}
origin: biz.aQute.bnd/bndlib

public static <T> T createConfigurable(Class<T> c, Dictionary< ? , ? > properties) {
  Map<Object,Object> alt = new HashMap<Object,Object>();
  for (Enumeration< ? > e = properties.keys(); e.hasMoreElements();) {
    Object key = e.nextElement();
    alt.put(key, properties.get(key));
  }
  return createConfigurable(c, alt);
}
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/biz.aQute.bnd

private Collection<?> toCollection(Object o) {
  if (o instanceof Collection)
    return (Collection<?>) o;
  if (o.getClass()
    .isArray()) {
    if (o.getClass()
      .getComponentType()
      .isPrimitive()) {
      int length = Array.getLength(o);
      List<Object> result = new ArrayList<>(length);
      for (int i = 0; i < length; i++) {
        result.add(Array.get(o, i));
      }
      return result;
    }
    return Arrays.asList((Object[]) o);
  }
  if (o instanceof String) {
    String s = (String) o;
    if (SPLITTER_P.matcher(s)
      .find())
      return Arrays.asList(s.split("\\|"));
    else
      return unescape(s);
  }
  return Arrays.asList(o);
}
origin: biz.aQute.bnd/biz.aQute.bnd.annotation

public static <T> T createConfigurable(Class<T> c, Dictionary<?, ?> properties) {
  Map<Object, Object> alt = new HashMap<>();
  for (Enumeration<?> e = properties.keys(); e.hasMoreElements();) {
    Object key = e.nextElement();
    alt.put(key, properties.get(key));
  }
  return createConfigurable(c, alt);
}
aQute.bnd.annotation.metatypeConfigurable

Most used methods

  • createConfigurable
  • mangleMethodName
  • unescape

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Collectors (java.util.stream)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top plugins for Android Studio
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