org.jvnet.hk2.config.DomDocument.buildModel()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中org.jvnet.hk2.config.DomDocument.buildModel()方法的一些代码示例,展示了DomDocument.buildModel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DomDocument.buildModel()方法的具体详情如下:
包路径:org.jvnet.hk2.config.DomDocument
类名称:DomDocument
方法名:buildModel

DomDocument.buildModel介绍

[英]Obtains a ConfigModel for the given class (Which should have Configured annotation on it.)
[中]获取给定类的ConfigModel(该类上应配置注释)

代码示例

代码示例来源:origin: javaee/glassfish

/**
 * Obtains a {@link ConfigModel} for the given class (Which should have {@link Configured} annotation on it.)
 */
public ConfigModel buildModel(Class<?> clazz) {
  return buildModel(clazz.getName());
}

代码示例来源:origin: javaee/glassfish

@Deprecated
public ConfigModel getModel(Class c) {
  return buildModel(c);
}

代码示例来源:origin: javaee/glassfish

/**
 * Allocate a new ConfigBean object as part of the Transaction
 * associated with this configuration object. This will eventually
 * be moved to a factory.
 *
 * @param type the request configuration object type
 * @return the properly constructed configuration object
 */
public ConfigBean allocate(Class<?> type) {
  return (ConfigBean) document.make(getHabitat(), null, this, document.buildModel(type));
}

代码示例来源:origin: javaee/glassfish

/**
 * Obtains the {@link ConfigModel} from the "global" element name.
 *
 * <p>
 * This method uses {@link #buildModel} to lazily build models if necessary.
 * 
 * @return
 *      Null if no configurable component is registered under the given global element name.
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public ConfigModel getModelByElementName(String elementName) {
  ActiveDescriptor<?> i = habitat.getBestDescriptor(
      BuilderHelper.createNameAndContractFilter(ConfigInjector.class.getName(), elementName));
  if(i==null) return null;
  return buildModel((ActiveDescriptor<? extends ConfigInjector>) i);
}

代码示例来源:origin: javaee/glassfish

/**
 * Obtains a {@link ConfigModel} for the given class (Which should have {@link Configured} annotation on it.)
 */
public ConfigModel buildModel(String fullyQualifiedClassName) {
  
  ActiveDescriptor<? extends ConfigInjector<?>> desc;
  synchronized (cache) {
    desc = cache.get(fullyQualifiedClassName);
    if (desc == null) {
      desc = (ActiveDescriptor<? extends ConfigInjector<?>>)
        habitat.getBestDescriptor(new InjectionTargetFilter(fullyQualifiedClassName));
      
      if (desc == null) {
        throw new ConfigurationException("ConfigInjector for %s is not found, is it annotated with @Configured",fullyQualifiedClassName);
      }
    
      cache.put(fullyQualifiedClassName, desc);
    }
  }
  
  return buildModel(desc);
}

代码示例来源:origin: javaee/glassfish

ConfigModel model = document.buildModel(value);
prop = collection?new CollectionNode(model,elementName):new SingleNode(model,elementName);

代码示例来源:origin: javaee/glassfish

/**
 * probably a bit slow, calculates all the @Configured interfaces subclassing, useful
 * to find all possible subclasses of a type.
 * 
 * @throws ClassNotFoundException
 */
private void initXRef() throws ClassNotFoundException {
  // force initialization of all the config models.
  for (ServiceHandle<?> i : habitat.getAllServiceHandles(ConfigInjector.class)) {
    buildModel((ActiveDescriptor<? extends ConfigInjector>) i.getActiveDescriptor());
  }
  for (ConfigModel cm : models.values()) {
    Class targetType = cm.classLoaderHolder.loadClass(cm.targetTypeName);
    do {
      Class[] intfs = targetType.getInterfaces();
      for (Class intf : intfs) {
        if (intf.isAnnotationPresent(Configured.class)) {
          addXRef(intf, cm);
        }
      }
      targetType = targetType.getSuperclass();
    } while (targetType!=null);
  }
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

/**
 * Obtains a {@link ConfigModel} for the given class (Which should have {@link Configured} annotation on it.)
 */
public ConfigModel buildModel(Class<?> clazz) {
  return buildModel(clazz.getName());
}

代码示例来源:origin: org.glassfish.hk2/config

/**
 * Obtains a {@link ConfigModel} for the given class (Which should have {@link Configured} annotation on it.)
 */
public ConfigModel buildModel(Class<?> clazz) {
  return buildModel(clazz.getName());
}

代码示例来源:origin: com.sun.enterprise/config

/**
 * Obtains a {@link ConfigModel} for the given class (Which should have {@link Configured} annotation on it.)
 */
public ConfigModel buildModel(Class<?> clazz) {
  return buildModel(clazz.getName());
}

代码示例来源:origin: com.sun.enterprise/config

@Deprecated
public ConfigModel getModel(Class c) {
  return buildModel(c);
}

代码示例来源:origin: org.glassfish.hk2/config

@Deprecated
public ConfigModel getModel(Class c) {
  return buildModel(c);
}

代码示例来源:origin: eclipse-ee4j/glassfish

@Deprecated
public ConfigModel getModel(Class c) {
  return buildModel(c);
}

代码示例来源:origin: eclipse-ee4j/glassfish

/**
 * Obtains a {@link ConfigModel} for the given class (Which should have {@link Configured} annotation on it.)
 */
public ConfigModel buildModel(Class<?> clazz) {
  return buildModel(clazz.getName());
}

代码示例来源:origin: org.glassfish.hk2/config

/**
 * Allocate a new ConfigBean object as part of the Transaction
 * associated with this configuration object. This will eventually
 * be moved to a factory.
 *
 * @param type the request configuration object type
 * @return the properly constructed configuration object
 */
public ConfigBean allocate(Class<?> type) {
  return (ConfigBean) document.make(habitat, null, this, document.buildModel(type));
}

代码示例来源:origin: com.sun.enterprise/config

/**
 * Allocate a new ConfigBean object as part of the Transaction
 * associated with this configuration object. This will eventually
 * be moved to a factory.
 *
 * @param type the request configuration object type
 * @return the properly constructed configuration object
 */
public ConfigBean allocate(Class<?> type) {
  return (ConfigBean) document.make(habitat, null, this, document.buildModel(type));
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

/**
 * Allocate a new ConfigBean object as part of the Transaction
 * associated with this configuration object. This will eventually
 * be moved to a factory.
 *
 * @param type the request configuration object type
 * @return the properly constructed configuration object
 */
public ConfigBean allocate(Class<?> type) {
  return (ConfigBean) document.make(getHabitat(), null, this, document.buildModel(type));
}

代码示例来源:origin: com.sun.enterprise/config

/**
 * Obtains a {@link ConfigModel} for the given class (Which should have {@link Configured} annotation on it.)
 */
public ConfigModel buildModel(String fullyQualifiedClassName) {
  Inhabitant i = habitat.getInhabitantByAnnotation(InjectionTarget.class, fullyQualifiedClassName);
  if(i==null)
    throw new ComponentException("ConfigInjector for %s is not found, is it annotated with @Configured",fullyQualifiedClassName);
  return buildModel(i);
}

代码示例来源:origin: org.glassfish.hk2/config

/**
 * Obtains a {@link ConfigModel} for the given class (Which should have {@link Configured} annotation on it.)
 */
public ConfigModel buildModel(String fullyQualifiedClassName) {
  Inhabitant i = habitat.getInhabitantByAnnotation(InjectionTarget.class, fullyQualifiedClassName);
  if(i==null)
    throw new ComponentException("ConfigInjector for %s is not found, is it annotated with @Configured",fullyQualifiedClassName);
  return buildModel(i);
}

代码示例来源:origin: eclipse-ee4j/glassfish

/**
 * Allocate a new ConfigBean object as part of the Transaction
 * associated with this configuration object. This will eventually
 * be moved to a factory.
 *
 * @param type the request configuration object type
 * @return the properly constructed configuration object
 */
public ConfigBean allocate(Class<?> type) {
  return (ConfigBean) document.make(getHabitat(), null, this, document.buildModel(type));
}

相关文章