Tabnine Logo
PetiteConfig.resolveWiringMode
Code IndexAdd Tabnine to your IDE (free)

How to use
resolveWiringMode
method
in
jodd.petite.PetiteConfig

Best Java code snippets using jodd.petite.PetiteConfig.resolveWiringMode (Showing top 11 results out of 315)

origin: oblac/jodd

/**
 * Adds object instance to the container as singleton bean.
 */
public void addBean(final String name, final Object bean, WiringMode wiringMode) {
  wiringMode = petiteConfig.resolveWiringMode(wiringMode);
  registerPetiteBean(bean.getClass(), name, SingletonScope.class, wiringMode, false, null);
  BeanDefinition def = lookupExistingBeanDefinition(name);
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(new BeanData(this, def, bean));
}
origin: oblac/jodd

/**
 * Wires provided bean with the container and optionally invokes init methods.
 * Bean is <b>not</b> registered withing container.
 */
public void wire(final Object bean, final WiringMode wiringMode) {
  final WiringMode finalWiringMode = petiteConfig.resolveWiringMode(wiringMode);
  final BeanDefinition def = externalsCache.get(
    bean.getClass(), () -> {
      final BeanDefinition beanDefinition = createBeandDefinitionForExternalBeans(bean.getClass(), finalWiringMode);
      initBeanDefinition(beanDefinition);
      return beanDefinition;
    });
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(new BeanData(this, def, bean));
}
origin: oblac/jodd

/**
 * Invokes the method of some bean with the container, when its parameters requires to be injected into.
 * The bean is <b>not</b> registered within container.
 */
public <T> T invokeMethod(final Object bean, final Method method) {
  final WiringMode wiringMode = petiteConfig.resolveWiringMode(null);
  final BeanDefinition def = externalsCache.get(
    bean.getClass(), () -> {
      final BeanDefinition beanDefinition = createBeandDefinitionForExternalBeans(bean.getClass(), wiringMode);
      initBeanDefinition(beanDefinition);
      return beanDefinition;
    });
  final BeanData beanData = new BeanData(this, def, bean);
  for (MethodInjectionPoint methodInjectionPoint : def.methods) {
    if (methodInjectionPoint.method.equals(method)) {
      return (T) beanData.invokeMethodInjectionPoint(methodInjectionPoint);
    }
  }
  try {
    return (T) method.invoke(bean);
  } catch (Exception e) {
    throw new PetiteException(e);
  }
}
origin: oblac/jodd

/**
 * Creates and wires a bean within the container and optionally invokes init methods. However, bean is
 * <b>not</b> registered.
 */
@SuppressWarnings({"unchecked"})
public <E> E createBean(final Class<E> type, final WiringMode wiringMode) {
  final WiringMode finalWiringMode = petiteConfig.resolveWiringMode(wiringMode);
  final BeanDefinition def = externalsCache.get(
    type, () -> {
      final BeanDefinition beanDefinition = createBeandDefinitionForExternalBeans(type, finalWiringMode);
      initBeanDefinition(beanDefinition);
      return beanDefinition;
    });
  final BeanData<E> beanData = new BeanData(this, def);
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(beanData);
  return beanData.bean();
}
origin: org.jodd/jodd-wot

/**
 * Wires provided bean with the container and optionally invokes init methods.
 * Bean is not registered.
 */
public void wire(Object bean, WiringMode wiringMode, boolean init) {
  wiringMode = petiteConfig.resolveWiringMode(wiringMode);
  BeanDefinition def = new BeanDefinition(null, bean.getClass(), null, wiringMode);
  wireBean(bean, def, new HashMap<String, Object>());
  if (init) {
    invokeInitMethods(bean,  def, null);
  }
}
origin: org.jodd/jodd-petite

/**
 * Adds object instance to the container as singleton bean.
 */
public void addBean(final String name, final Object bean, WiringMode wiringMode) {
  wiringMode = petiteConfig.resolveWiringMode(wiringMode);
  registerPetiteBean(bean.getClass(), name, SingletonScope.class, wiringMode, false, null);
  BeanDefinition def = lookupExistingBeanDefinition(name);
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(new BeanData(this, def, bean));
}
origin: org.jodd/jodd-petite

/**
 * Wires provided bean with the container and optionally invokes init methods.
 * Bean is <b>not</b> registered withing container.
 */
public void wire(final Object bean, final WiringMode wiringMode) {
  final WiringMode finalWiringMode = petiteConfig.resolveWiringMode(wiringMode);
  final BeanDefinition def = externalsCache.get(
    bean.getClass(), () -> {
      final BeanDefinition beanDefinition = createBeandDefinitionForExternalBeans(bean.getClass(), finalWiringMode);
      initBeanDefinition(beanDefinition);
      return beanDefinition;
    });
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(new BeanData(this, def, bean));
}
origin: org.jodd/jodd-wot

/**
 * Creates and wires a bean within the container and optionally invokes init methods. However, bean is
 * <b>not</b> registered.
 */
@SuppressWarnings({"unchecked"})
public <E> E createBean(Class<E> type, WiringMode wiringMode, boolean init) {
  wiringMode = petiteConfig.resolveWiringMode(wiringMode);
  BeanDefinition def = new BeanDefinition(null, type, null, wiringMode);
  Map<String, Object> acquiredBeans = new HashMap<String, Object>();
  Object bean = newBeanInstance(def, acquiredBeans);
  wireBean(bean, def, acquiredBeans);
  if (init) {
    invokeInitMethods(bean, def, null);
  }
  return (E) bean;
}
origin: org.jodd/jodd-wot

/**
 * Adds object instance to the container as singleton bean.
 */
public void addBean(String name, Object bean, WiringMode wiringMode) {
  wiringMode = petiteConfig.resolveWiringMode(wiringMode);
  registerBean(name, bean.getClass(), SingletonScope.class, wiringMode);
  BeanDefinition def = lookupExistingBeanDefinition(name);
  Map<String, Object> acquiredBeans = new HashMap<String, Object>();
  acquiredBeans.put(name, bean);
  wireBean(bean, def, acquiredBeans);
  invokeInitMethods(bean, def, Boolean.TRUE);
  injectParams(bean, def);
  invokeInitMethods(bean, def, Boolean.FALSE);
  def.scopeRegister(bean);
}
origin: org.jodd/jodd-petite

/**
 * Invokes the method of some bean with the container, when its parameters requires to be injected into.
 * The bean is <b>not</b> registered within container.
 */
public <T> T invokeMethod(final Object bean, final Method method) {
  final WiringMode wiringMode = petiteConfig.resolveWiringMode(null);
  final BeanDefinition def = externalsCache.get(
    bean.getClass(), () -> {
      final BeanDefinition beanDefinition = createBeandDefinitionForExternalBeans(bean.getClass(), wiringMode);
      initBeanDefinition(beanDefinition);
      return beanDefinition;
    });
  final BeanData beanData = new BeanData(this, def, bean);
  for (MethodInjectionPoint methodInjectionPoint : def.methods) {
    if (methodInjectionPoint.method.equals(method)) {
      return (T) beanData.invokeMethodInjectionPoint(methodInjectionPoint);
    }
  }
  try {
    return (T) method.invoke(bean);
  } catch (Exception e) {
    throw new PetiteException(e);
  }
}
origin: org.jodd/jodd-petite

/**
 * Creates and wires a bean within the container and optionally invokes init methods. However, bean is
 * <b>not</b> registered.
 */
@SuppressWarnings({"unchecked"})
public <E> E createBean(final Class<E> type, final WiringMode wiringMode) {
  final WiringMode finalWiringMode = petiteConfig.resolveWiringMode(wiringMode);
  final BeanDefinition def = externalsCache.get(
    type, () -> {
      final BeanDefinition beanDefinition = createBeandDefinitionForExternalBeans(type, finalWiringMode);
      initBeanDefinition(beanDefinition);
      return beanDefinition;
    });
  final BeanData<E> beanData = new BeanData(this, def);
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(beanData);
  return beanData.bean();
}
jodd.petitePetiteConfigresolveWiringMode

Javadoc

Resolves wiring mode by checking if default and null values.

Popular methods of PetiteConfig

  • <init>
  • getDefaultWiringMode
    Returns default wiring mode.
  • getDetectDuplicatedBeanNames
    Returns true if container detects duplicated bean names.
  • getLookupReferences
  • getResolveReferenceParameters
    Returns true if parameter references should be resolved.
  • getUseFullTypeNames
  • getUseParamo
  • isDetectMixedScopes
  • isImplicitParamInjection
    Returns true if implicit parameter injection is enabled.
  • isUseAltBeanNames
    Returns if alternative bean names are in use.
  • isWireScopedProxy
  • setDetectDuplicatedBeanNames
    Specifies if an exception should be thrown if two beans with same exception are registered with this
  • isWireScopedProxy,
  • setDetectDuplicatedBeanNames,
  • setDetectMixedScopes,
  • setWireScopedProxy,
  • getDefaultRunInitMethods,
  • getDefaultScope,
  • setDefaultWiringMode,
  • setImplicitParamInjection,
  • setLookupReferences

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 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