private static String loadExistingBoundaryValue(JAnnotationUse jAnnotationUse) { JAnnotationValue jAnnotationValue = jAnnotationUse.getAnnotationMembers().get("value"); Class<? extends JAnnotationValue> clazz = jAnnotationValue.getClass(); try { Field theValueField = clazz.getDeclaredField("value"); theValueField.setAccessible(true); return ((JStringLiteral) theValueField.get(jAnnotationValue)).str; } catch (Exception e) { // Nothing we can do, user should be notified that his app is unable to // execute this plugin correctly and not should not receive generated default values. throw new RuntimeException(e); } }
private static String loadExistingBoundaryValue(JAnnotationUse jAnnotationUse) { JAnnotationValue jAnnotationValue = jAnnotationUse.getAnnotationMembers().get(VALUE); Class<? extends JAnnotationValue> clazz = jAnnotationValue.getClass(); try { Field theValueField = clazz.getDeclaredField(VALUE); theValueField.setAccessible(true); return ((JStringLiteral) theValueField.get(jAnnotationValue)).str; } catch (Exception e) { // Nothing we can do, user should be notified that his app is unable to // execute this plugin correctly and not should not receive generated default values. throw new RuntimeException(e); } }
@Override protected void onClass(final ClassOutline classOutline) { String namespace = null; for (final JAnnotationUse annot : classOutline.implClass.annotations()) { final String fullName = annot.getAnnotationClass().fullName(); if (xmlTypeName.equals(fullName)) { final JAnnotationValue value = annot.getAnnotationMembers().get("namespace"); if (value != null) { final StringWriter w = new StringWriter(); value.generate(new JFormatter(w)); namespace = w.toString(); namespace = namespace.substring(1, namespace.length() - 1); // remove quotes } } else if (xmlRootEltName.equals(fullName)) { namespace = null; break; } } if (null == namespace) { return; } classOutline.implClass.annotate(XmlRootElement.class) .param("namespace", namespace) .param("name", toXml(classOutline.implClass.name())); } }
try annotations = annotation.getAnnotationMembers();
if (XmlElementDecl.class.getName().equals(annotationUse.getAnnotationClass().fullName())) { JAnnotationValue namespaceValue = annotationUse.getAnnotationMembers().get("namespace"); StringWriter namespaceWriter = new StringWriter(); JFormatter namespaceFormatter = new JFormatter(namespaceWriter); namespaceValue.generate(namespaceFormatter); JAnnotationValue nameValue = annotationUse.getAnnotationMembers().get("name"); StringWriter nameWriter = new StringWriter(); JFormatter nameFormatter = new JFormatter(nameWriter);
for (JAnnotationUse annot : annotatableParent.annotations()) { if (annot.getAnnotationClass().fullName().equals(JsonSubTypes.class.getCanonicalName())) { annotationValues = (JAnnotationArrayMember)annot.getAnnotationMembers().get("value"); break;
xmlTypeModelClass).getAnnotationMembers().get("propOrder");
xmlTypeModelClass).getAnnotationMembers().get("propOrder");