gpt4 book ai didi

com.ning.billing.util.config.catalog.XMLLoader.getObjectFromUri()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 11:30:40 27 4
gpt4 key购买 nike

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

XMLLoader.getObjectFromUri介绍

暂无

代码示例

代码示例来源:origin: com.ning.billing/killbill-catalog

public static void main(final String[] args) throws Exception {
  if (args.length != 1) {
    System.err.println("Usage: <catalog filepath>");
    System.exit(0);
  }
  File file = new File(args[0]);
  if(!file.exists()) {
    System.err.println("Error: '" + args[0] + "' does not exist");
  }
  StandaloneCatalog catalog = XMLLoader.getObjectFromUri(file.toURI(), StandaloneCatalog.class);   
  if (catalog != null) {
    System.out.println("Success: Catalog loads!");
  }
}

代码示例来源:origin: com.ning.billing/killbill-catalog

final StandaloneCatalog catalog = XMLLoader.getObjectFromUri(u, StandaloneCatalog.class);
result.add(catalog);

代码示例来源:origin: com.ning.billing/killbill-catalog

@Test(groups = "fast")
  public void test() throws Exception {
    final URI uri = new URI(Resources.getResource("WeaponsHireSmall.xml").toExternalForm());
    final StandaloneCatalog catalog = XMLLoader.getObjectFromUri(uri, StandaloneCatalog.class);
    Assert.assertNotNull(catalog);
    final PlanRules rules = catalog.getPlanRules();

    final PlanSpecifier specifier = new PlanSpecifier("Laser-Scope", ProductCategory.ADD_ON, BillingPeriod.MONTHLY,
                             "DEFAULT");

    final PlanAlignmentCreate alignment = rules.getPlanCreateAlignment(specifier, catalog);
    Assert.assertEquals(alignment, PlanAlignmentCreate.START_OF_SUBSCRIPTION);

    final PlanSpecifier specifier2 = new PlanSpecifier("Extra-Ammo", ProductCategory.ADD_ON, BillingPeriod.MONTHLY,
                              "DEFAULT");

    final PlanAlignmentCreate alignment2 = rules.getPlanCreateAlignment(specifier2, catalog);
    Assert.assertEquals(alignment2, PlanAlignmentCreate.START_OF_BUNDLE);
  }
}

代码示例来源:origin: com.ning.billing/killbill-overdue

@LifecycleHandlerType(LifecycleLevel.LOAD_CATALOG)
public synchronized void loadConfig() throws ServiceException {
  if (!isConfigLoaded) {
    try {
      final URI u = new URI(properties.getConfigURI());
      overdueConfig = XMLLoader.getObjectFromUri(u, OverdueConfig.class);
      // File not found?
      if (overdueConfig == null) {
        log.warn("Unable to load the overdue config from " + properties.getConfigURI());
        overdueConfig = new OverdueConfig();
      }
      isConfigLoaded = true;
    } catch (final URISyntaxException e) {
      overdueConfig = new OverdueConfig();
    } catch (final IllegalArgumentException e) {
      overdueConfig = new OverdueConfig();
    } catch (final Exception e) {
      throw new ServiceException(e);
    }
    factory.setOverdueConfig(overdueConfig);
    ((DefaultOverdueUserApi) userApi).setOverdueConfig(overdueConfig);
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com