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; }
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);
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);
JStaticClass() { super(pkg.owner()); // TODO: allow those to be specified typeParams = new JTypeVar[0]; }
JStaticClass() { super(pkg.owner()); // TODO: allow those to be specified typeParams = new JTypeVar[0]; }
JStaticClass() { super(pkg.owner()); // TODO: allow those to be specified typeParams = new JTypeVar[0]; }
JStaticClass() { super(pkg.owner()); // TODO: allow those to be specified typeParams = new JTypeVar[0]; }
JStaticClass() { super(pkg.owner()); // TODO: allow those to be specified typeParams = new JTypeVar[0]; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
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; }
if( this==_package().owner().ref(Object.class) ) return true;