com.sun.codemodel.JPackage.subPackage()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(146)

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

JPackage.subPackage介绍

[英]Gets a reference to a sub package of this package.
[中]

代码示例

代码示例来源:origin: apache/servicemix-bundles

protected JPackage getPackage(JPackage pkg, Aspect a) {
  switch(a) {
  case EXPOSED:
    return pkg;
  case IMPLEMENTATION:
    return pkg.subPackage("impl");
  default:
    assert false;
    throw new IllegalStateException();
  }
}

代码示例来源:origin: sun-jaxb/jaxb-xjc

protected JPackage getPackage(JPackage pkg, Aspect a) {
  switch(a) {
  case EXPOSED:
    return pkg;
  case IMPLEMENTATION:
    return pkg.subPackage("impl");
  default:
    assert false;
    throw new IllegalStateException();
  }
}

代码示例来源:origin: org.andromda.thirdparty.jaxb2_commons/jaxb-xjc

protected JPackage getPackage(JPackage pkg, Aspect a) {
  switch(a) {
  case EXPOSED:
    return pkg;
  case IMPLEMENTATION:
    return pkg.subPackage("impl");
  default:
    assert false;
    throw new IllegalStateException();
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc

protected JPackage getPackage(JPackage pkg, Aspect a) {
  switch(a) {
  case EXPOSED:
    return pkg;
  case IMPLEMENTATION:
    return pkg.subPackage("impl");
  default:
    assert false;
    throw new IllegalStateException();
  }
}

代码示例来源:origin: org.glassfish.metro/webservices-tools

protected JPackage getPackage(JPackage pkg, Aspect a) {
  switch(a) {
  case EXPOSED:
    return pkg;
  case IMPLEMENTATION:
    return pkg.subPackage("impl");
  default:
    assert false;
    throw new IllegalStateException();
  }
}

代码示例来源:origin: org.glassfish.metro/webservices-tools

public final JClass addRuntime(Class clazz) {
  JClass g = generatedRuntime.get(clazz);
  if (g == null) {
    // put code into a separate package to avoid name conflicts.
    JPackage implPkg = getUsedPackages(Aspect.IMPLEMENTATION)[0].subPackage("runtime");
    g = generateStaticClass(clazz, implPkg);
    generatedRuntime.put(clazz, g);
  }
  return g;
}

代码示例来源:origin: apache/servicemix-bundles

public final JClass addRuntime(Class clazz) {
  JClass g = generatedRuntime.get(clazz);
  if (g == null) {
    // put code into a separate package to avoid name conflicts.
    JPackage implPkg = getUsedPackages(Aspect.IMPLEMENTATION)[0].subPackage("runtime");
    g = generateStaticClass(clazz, implPkg);
    generatedRuntime.put(clazz, g);
  }
  return g;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc

public final JClass addRuntime(Class clazz) {
  JClass g = generatedRuntime.get(clazz);
  if (g == null) {
    // put code into a separate package to avoid name conflicts.
    JPackage implPkg = getUsedPackages(Aspect.IMPLEMENTATION)[0].subPackage("runtime");
    g = generateStaticClass(clazz, implPkg);
    generatedRuntime.put(clazz, g);
  }
  return g;
}

代码示例来源:origin: sun-jaxb/jaxb-xjc

public final JClass addRuntime(Class clazz) {
  JClass g = generatedRuntime.get(clazz);
  if(g==null) {
    // put code into a separate package to avoid name conflicts.
    JPackage implPkg = getUsedPackages(Aspect.IMPLEMENTATION)[0].subPackage("runtime");
    g = generateStaticClass(clazz,implPkg);
    generatedRuntime.put(clazz,g);
  }
  return g;
}

代码示例来源:origin: org.andromda.thirdparty.jaxb2_commons/jaxb-xjc

public final JClass addRuntime(Class clazz) {
  JClass g = generatedRuntime.get(clazz);
  if(g==null) {
    // put code into a separate package to avoid name conflicts.
    JPackage implPkg = getUsedPackages(Aspect.IMPLEMENTATION)[0].subPackage("runtime");
    g = generateStaticClass(clazz,implPkg);
    generatedRuntime.put(clazz,g);
  }
  return g;
}

代码示例来源:origin: org.andromda.thirdparty.jaxb2_commons/jaxb-xjc

public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) {
  super(outline, model, targetPackage.subPackage("impl"));
  JPackage implPkg = targetPackage.subPackage("impl");
  // put JAXBContextFactory into the impl package
  JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg);
  // and then put jaxb.properties to point to it
  JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties");
  targetPackage.addResourceFile(jaxbProperties);
  jaxbProperties.add(
    JAXBContext.JAXB_CONTEXT_FACTORY,
    factory.fullName());
}

代码示例来源:origin: apache/servicemix-bundles

public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) {
  super(outline, model, targetPackage.subPackage("impl"));
  JPackage implPkg = targetPackage.subPackage("impl");
  // put JAXBContextFactory into the impl package
  JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg);
  // and then put jaxb.properties to point to it
  JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties");
  targetPackage.addResourceFile(jaxbProperties);
  jaxbProperties.add(
    JAXBContext.JAXB_CONTEXT_FACTORY,
    factory.fullName());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc

public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) {
  super(outline, model, targetPackage.subPackage("impl"));
  JPackage implPkg = targetPackage.subPackage("impl");
  // put JAXBContextFactory into the impl package
  JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg);
  // and then put jaxb.properties to point to it
  JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties");
  targetPackage.addResourceFile(jaxbProperties);
  jaxbProperties.add(
    JAXBContext.JAXB_CONTEXT_FACTORY,
    factory.fullName());
}

代码示例来源:origin: org.glassfish.metro/webservices-tools

public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) {
  super(outline, model, targetPackage.subPackage("impl"));
  JPackage implPkg = targetPackage.subPackage("impl");
  // put JAXBContextFactory into the impl package
  JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg);
  // and then put jaxb.properties to point to it
  JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties");
  targetPackage.addResourceFile(jaxbProperties);
  jaxbProperties.add(
    JAXBContext.JAXB_CONTEXT_FACTORY,
    factory.fullName());
}

代码示例来源:origin: sun-jaxb/jaxb-xjc

public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) {
  super(outline, model, targetPackage.subPackage("impl"));
  JPackage implPkg = targetPackage.subPackage("impl");
  // put JAXBContextFactory into the impl package
  JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg);
  // and then put jaxb.properties to point to it
  JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties");
  targetPackage.addResourceFile(jaxbProperties);
  jaxbProperties.add(
    JAXBContext.JAXB_CONTEXT_FACTORY,
    factory.fullName());
}

代码示例来源:origin: com.sap.cloud.yaas.rammler/rammler-core

final JPackage thePackage = parentPackage.subPackage(packageName.toString());
context.registerNode(subPackagePath, thePackage);

代码示例来源:origin: jenkinsci/maven-hpi-plugin

if (children!=null) {
  for (File child : children)
    walk(child,pkg.subPackage(h2j(child.getName())),dirName+'/'+child.getName());

代码示例来源:origin: nokia/Avro-Schema-Generator

private void generateAvroSchemas(JPackage rootPackage, Set<NamedAvroType> avroTypes) {
  JPackage avroPackage = rootPackage.subPackage("avroSchemas");
  System.out.println("Writing schemas under package '"+ avroPackage.name() +"'");
  // check for name collisions
  checkForCollisions(avroTypes);
  // sort results by dependency
  List<NamedAvroType> orderedTypes = topologicalSort(avroTypes);
  
  // add in special types
  for (String ns : helper.getSpecialSchemas().get(DateAvroType.class)) {
    orderedTypes.add(0, DateAvroType.getSchema(ns));
  }
  for (String ns : helper.getSpecialSchemas().get(ReferenceAvroType.class)) {
    orderedTypes.add(0, ReferenceAvroType.getSchema(ns));
  }
  // output in an ordered way
  outputSchema(avroPackage, orderedTypes);
  // output debug summary
  JTextFile avroSchema = new JTextFile("avroSchemas.txt");
  StringBuilder sb = new StringBuilder();
  for (NamedAvroType type : orderedTypes) {
    sb.append(getJson(type));
  }
  
  avroSchema.setContents(sb.toString());
  rootPackage.addResourceFile(avroSchema);
}

代码示例来源:origin: jpmml/jpmml-model

JPackage subPackage = packageParent.pkg.subPackage(name);

相关文章