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

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

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

JPackage.remove介绍

[英]Removes a class from this package.
[中]

代码示例

代码示例来源:origin: joelittlejohn/jsonschema2pojo

private String makeUnique(String className, JPackage _package) {
  try {
    JDefinedClass _class = _package._class(className);
    _package.remove(_class);
    return className;
  } catch (JClassAlreadyExistsException e) {
    return makeUnique(MakeUniqueClassName.makeUnique(className), _package);
  }
}

代码示例来源:origin: com.sap.cloud.yaas.service-generator/service-generator-model-raml

private void revertChanges(final Map<String, JType> previousMappings)
{
  final Map<String, JType> newMappings = mappingDelegate.getMappings();
  final Set<String> addedMappings = new HashSet<>(newMappings.keySet());
  addedMappings.removeAll(previousMappings.keySet());
  for (final String key : addedMappings)
  {
    mappingDelegate.removeMapping(key);
    final JType type = newMappings.get(key);
    if (type instanceof JDefinedClass)
    {
      final JDefinedClass defClass = (JDefinedClass) type;
      defClass._package().remove(defClass);
    }
  }
}

代码示例来源:origin: com.googlecode.jsonschema2pojo/jsonschema2pojo-core

private String makeUnique(String className, JPackage _package) {
  try {
    JDefinedClass _class = _package._class(className);
    _package.remove(_class);
    return className;
  } catch (JClassAlreadyExistsException e) {
    return makeUnique(className + "_", _package);
  }
}

代码示例来源:origin: com.sap.cloud.yaas.service-generator/service-generator-model-raml

/**
 * Reverts the class being added to global Schema storage.
 */
static void removeClassFromSchema(final Schema schema, final JPackage classPackage)
{
  if (schema.getJavaType() instanceof JClass)
  {
    classPackage.remove((JClass) schema.getJavaType());
  }
  schema.setJavaType(null);
}

代码示例来源:origin: org.jsonschema2pojo/jsonschema2pojo-core

private String makeUnique(String className, JPackage _package) {
  try {
    JDefinedClass _class = _package._class(className);
    _package.remove(_class);
    return className;
  } catch (JClassAlreadyExistsException e) {
    return makeUnique(MakeUniqueClassName.makeUnique(className), _package);
  }
}

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

/**
 * {@inheritDoc}
 * <p>
 * This implementation emits Java client code for all resources that are defined in the {@link Raml} API model.
 */
@Override
public void procreate(final RamlProvider ramlProvider, final CodeEmitter<? super JCodeModel> codeEmitter)
{
  final Raml raml = ramlProvider.obtainRaml(config);
  LOG.info("Procreating Java client from RAML ...");
  final Context<Object, JDeclaration> context = new TaxonomicContext<Object, JDeclaration>(config);
  final JCodeModel codeModel = new JCodeModel();
  // the following dummy class is necessary to pass a reference to the codeModel to the JavaProcreator
  // interface
  final JDefinedClass dummy = createDummyClass(codeModel);
  clientProcreator.procreate(raml, dummy, context);
  codeModel.rootPackage().remove(dummy);
  LOG.info("done.");
  codeEmitter.emit(codeModel, config);
}

代码示例来源:origin: dmak/jaxb-xew-plugin

parentPackage.remove(clazz);

代码示例来源:origin: com.github.jaxb-xew-plugin/jaxb-xew-plugin

parentPackage.remove(clazz);

代码示例来源:origin: mklemm/jaxb2-rich-contract-plugin

container.remove(dummyImplementation.implClass);
final JDefinedClass groupInterface;
final JDefinedClass supportInterface;

相关文章