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

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

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

DomDocument.getAllModelsImplementing介绍

[英]Calculates all @Configured interfaces subclassing the passed interface type.
[中]计算所有@Configured接口子类化传递的接口类型。

代码示例

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

List<ConfigModel> subChildrenModels = document.getAllModelsImplementing(
    childCM.classLoaderHolder.get().loadClass(childTypeName));
if (subChildrenModels!=null) {

代码示例来源:origin: org.glassfish.main.common/amx-core

/** works only for @Configured types */
public static Class[] getTypesImplementing(final Class<?> clazz)
{
  final DomDocument domDoc = new DomDocument(InjectedValues.getInstance().getHabitat());
  try
  {
    final List<ConfigModel> models = domDoc.getAllModelsImplementing(clazz);
    final Class[] interfaces = new Class[models == null ? 0 : models.size()];
    if (models != null)
    {
      int i = 0;
      for (final ConfigModel model : models)
      {
        final String classname = model.targetTypeName;
        final Class<?> intf = model.classLoaderHolder.loadClass(classname);
        interfaces[i] = intf;
        //System.out.println( "Loaded: " + intf + " with tagName of " + model.getTagName() );
        ++i;
      }
    }
    return interfaces;
  }
  catch (final Exception e)
  {
    AMXLoggerInfo.getLogger().log( Level.INFO, AMXLoggerInfo.cantGetTypesImplementing, 
        new Object[] {clazz, e.getLocalizedMessage()} );
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: org.glassfish.main.admin/config-api

List<ConfigModel> subChildrenModels = document.getAllModelsImplementing(
    childCM.classLoaderHolder.loadClass(childTypeName));
if (subChildrenModels!=null) {

相关文章