@Override public int compare(JClass object1, JClass object2) { if (object1 == null && object2 == null) { return 0; } if (object1 == null) { return 1; } if (object2 == null) { return -1; } final String name1 = object1.fullName(); final String name2 = object2.fullName(); if (name1 == null && name2 == null) { return 0; } if (name1 == null) { return 1; } if (name2 == null) { return -1; } return name1.compareTo(name2); } };
/** * Applies this schema rule to take the required code generation steps. * <p> * For each property present within the properties node, this rule will * invoke the 'property' rule provided by the given schema mapper. * * @param nodeName * the name of the node for which properties are being added * @param node * the properties node, containing property names and their * definition * @param jclass * the Java type which will have the given properties added * @return the given jclass */ @Override public JDefinedClass apply(String nodeName, JsonNode node, JsonNode parent, JDefinedClass jclass, Schema schema) { if (node == null) { node = JsonNodeFactory.instance.objectNode(); } for (Iterator<String> properties = node.fieldNames(); properties.hasNext(); ) { String property = properties.next(); ruleFactory.getPropertyRule().apply(property, node.get(property), node, jclass, schema); } if (ruleFactory.getGenerationConfig().isGenerateBuilders() && !jclass._extends().name().equals("Object")) { addOverrideBuilders(jclass, jclass.owner()._getClass(jclass._extends().fullName())); } ruleFactory.getAnnotator().propertyOrder(jclass, node); return jclass; }
if (!jclass._extends().fullName().equals(Object.class.getName())) { body.assign(result, result.mul(JExpr.lit(31)).plus(JExpr._super().invoke("hashCode")));
if (!jclass._extends().fullName().equals(Object.class.getName())) { result = result.cand(JExpr._super().invoke("equals").arg(rhsVar));
if (!jclass._extends().fullName().equals(Object.class.getName())) { JVar baseLength = body.decl(jclass.owner().INT, "baseLength", sb.invoke("length")); JVar superString = body.decl(jclass.owner().ref(String.class), "superString", JExpr._super().invoke("toString"));
public String fullName() { return clazz.fullName(); } }
public String fullName() { return base.fullName(); } }
public String fullName() { return clazz.fullName(); } }
@Override public String fullName() { return base.fullName(); }
private boolean isDefaultBoundary(String fieldVarType, String annotationClass, String boundaryValue) { return ANNOTATION_DECIMALMIN.fullName().equals(annotationClass) && nonFloatingDigitsClassesBoundaries.get(fieldVarType).min.equals(boundaryValue) || (ANNOTATION_DECIMALMAX.fullName().equals(annotationClass) && nonFloatingDigitsClassesBoundaries.get(fieldVarType).max.equals(boundaryValue)); }
@Override public boolean equals(Object obj) { if(!(obj instanceof JNarrowedClass)) return false; return fullName().equals(((JClass)obj).fullName()); }
@Override public boolean equals(Object obj) { if(!(obj instanceof JNarrowedClass)) return false; return fullName().equals(((JClass)obj).fullName()); }
@Override public boolean equals(Object obj) { if(!(obj instanceof JNarrowedClass)) return false; return fullName().equals(((JClass)obj).fullName()); }
public static String boxify(QName xmlTypeName, S2JJAXBModel jaxbModel) { TypeAndAnnotation typeAndAnnotation = jaxbModel.getJavaType(xmlTypeName); if (typeAndAnnotation == null) { return null; } return typeAndAnnotation.getTypeClass().boxify().fullName(); }
public static String getClassName(final JDefinedClass theClass) { return (theClass.outer() == null ? theClass.fullName() : getClassName((JDefinedClass) theClass .outer()) + "$" + theClass.name()); }
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()); }
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()); }