本文整理了Java中com.sun.codemodel.JPackage.owner()
方法的一些代码示例,展示了JPackage.owner()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPackage.owner()
方法的具体详情如下:
包路径:com.sun.codemodel.JPackage
类名称:JPackage
方法名:owner
[英]Return the code model root object being used to create this package.
[中]返回用于创建此包的代码模型根对象。
代码示例来源:origin: joelittlejohn/jsonschema2pojo
private JType getSuperType(String nodeName, JsonNode node, JPackage jPackage, Schema schema) {
if (node.has("extends") && node.has("extendsJavaClass")) {
throw new IllegalStateException("'extends' and 'extendsJavaClass' defined simultaneously");
}
JType superType = jPackage.owner().ref(Object.class);
Schema superTypeSchema = getSuperSchema(node, schema, false);
if (superTypeSchema != null) {
superType = ruleFactory.getSchemaRule().apply(nodeName + "Parent", node.get("extends"), node, jPackage, superTypeSchema);
} else if (node.has("extendsJavaClass")) {
superType = resolveType(jPackage, node.get("extendsJavaClass").asText());
}
return superType;
}
代码示例来源:origin: joelittlejohn/jsonschema2pojo
itemType = ruleFactory.getSchemaRule().apply(makeSingular(nodeName), node.get("items"), node, jpackage, schema);
} else {
itemType = jpackage.owner().ref(Object.class);
arrayType = jpackage.owner().ref(Set.class).narrow(itemType);
} else {
arrayType = jpackage.owner().ref(List.class).narrow(itemType);
代码示例来源:origin: joelittlejohn/jsonschema2pojo
String fqn = substringBefore(node.get("existingJavaType").asText(), "<");
if (isPrimitive(fqn, _package.owner())) {
throw new ClassAlreadyExistsException(primitiveType(fqn, _package.owner()));
String fqn = node.path("javaType").asText();
if (isPrimitive(fqn, _package.owner())) {
throw new GenerationException("javaType cannot refer to a primitive type (" + fqn + "), did you mean to use existingJavaType?");
newType = _package.owner()._class(JMod.PUBLIC, fqn, ClassType.CLASS);
} else {
newType = _package.owner()._class(fqn);
代码示例来源:origin: org.glassfish.metro/webservices-tools
JStaticClass() {
super(pkg.owner());
// TODO: allow those to be specified
typeParams = new JTypeVar[0];
}
代码示例来源:origin: javaee/jaxb-v2
JStaticClass() {
super(pkg.owner());
// TODO: allow those to be specified
typeParams = new JTypeVar[0];
}
代码示例来源:origin: sun-jaxb/jaxb-xjc
JStaticClass() {
super(pkg.owner());
// TODO: allow those to be specified
typeParams = new JTypeVar[0];
}
代码示例来源:origin: com.unquietcode.tools.jcodemodel/codemodel
JStaticClass() {
super(pkg.owner());
// TODO: allow those to be specified
typeParams = new JTypeVar[0];
}
代码示例来源:origin: com.sun.codemodel/codemodel
JStaticClass() {
super(pkg.owner());
// TODO: allow those to be specified
typeParams = new JTypeVar[0];
}
代码示例来源:origin: javaee/jaxb-v2
/**
* Creates, if necessary, and returns the package javadoc for this
* JDefinedClass.
*
* @return JDocComment containing javadocs for this class
*/
public JDocComment javadoc() {
if (jdoc == null)
jdoc = new JDocComment(owner());
return jdoc;
}
代码示例来源:origin: sun-jaxb/jaxb-xjc
/**
* Creates, if necessary, and returns the package javadoc for this
* JDefinedClass.
*
* @return JDocComment containing javadocs for this class
*/
public JDocComment javadoc() {
if (jdoc == null)
jdoc = new JDocComment(owner());
return jdoc;
}
代码示例来源:origin: com.sun.codemodel/codemodel
/**
* Creates, if necessary, and returns the package javadoc for this
* JDefinedClass.
*
* @return JDocComment containing javadocs for this class
*/
public JDocComment javadoc() {
if (jdoc == null)
jdoc = new JDocComment(owner());
return jdoc;
}
代码示例来源:origin: org.glassfish.metro/webservices-tools
/**
* Creates, if necessary, and returns the package javadoc for this
* JDefinedClass.
*
* @return JDocComment containing javadocs for this class
*/
public JDocComment javadoc() {
if (jdoc == null)
jdoc = new JDocComment(owner());
return jdoc;
}
代码示例来源:origin: com.unquietcode.tools.jcodemodel/codemodel
/**
* Creates, if necessary, and returns the package javadoc for this
* JDefinedClass.
*
* @return JDocComment containing javadocs for this class
*/
public JDocComment javadoc() {
if (jdoc == null)
jdoc = new JDocComment(owner());
return jdoc;
}
代码示例来源:origin: com.sun.codemodel/codemodel
/**
* Gets a reference to a sub package of this package.
*/
public JPackage subPackage( String pkg ) {
if(isUnnamed()) return owner()._package(pkg);
else return owner()._package(name+'.'+pkg);
}
代码示例来源:origin: javaee/jaxb-v2
/**
* Gets a reference to a sub package of this package.
*/
public JPackage subPackage( String pkg ) {
if(isUnnamed()) return owner()._package(pkg);
else return owner()._package(name+'.'+pkg);
}
代码示例来源:origin: org.glassfish.metro/webservices-tools
/**
* Gets a reference to a sub package of this package.
*/
public JPackage subPackage( String pkg ) {
if(isUnnamed()) return owner()._package(pkg);
else return owner()._package(name+'.'+pkg);
}
代码示例来源:origin: sun-jaxb/jaxb-xjc
/**
* Gets a reference to a sub package of this package.
*/
public JPackage subPackage( String pkg ) {
if(isUnnamed()) return owner()._package(pkg);
else return owner()._package(name+'.'+pkg);
}
代码示例来源:origin: com.unquietcode.tools.jcodemodel/codemodel
/**
* Gets a reference to a sub package of this package.
*/
public JPackage subPackage( String pkg ) {
if(isUnnamed()) return owner()._package(pkg);
else return owner()._package(name+'.'+pkg);
}
代码示例来源:origin: org.jsonschema2pojo/jsonschema2pojo-core
private JType getSuperType(String nodeName, JsonNode node, JPackage jPackage, Schema schema) {
if (node.has("extends") && node.has("extendsJavaClass")) {
throw new IllegalStateException("'extends' and 'extendsJavaClass' defined simultaneously");
}
JType superType = jPackage.owner().ref(Object.class);
Schema superTypeSchema = getSuperSchema(node, schema, false);
if (superTypeSchema != null) {
superType = ruleFactory.getSchemaRule().apply(nodeName + "Parent", node.get("extends"), node, jPackage, superTypeSchema);
} else if (node.has("extendsJavaClass")) {
superType = resolveType(jPackage, node.get("extendsJavaClass").asText());
}
return superType;
}
代码示例来源:origin: javaee/jaxb-v2
if( this==_package().owner().ref(Object.class) ) return true;
内容来源于网络,如有侵权,请联系作者删除!