/** * Creates a new annotation builder for the specified annotation type. * @return */ protected AnnotationBuilder newAnnotationBuilder( Class<? extends Annotation> annType) { return new AnnotationBuilder(annType); }
public AnnotationBuilder add(String key, String val) { return doAdd(key, val); }
public String toString() { StringBuilder sb = new StringBuilder(); toString(sb); return sb.toString(); }
@SuppressWarnings("unchecked") void toString(StringBuilder sb) { if (null != key) sb.append(key).append("="); List.class.getTypeParameters(); if (value instanceof List) { sb.append("{"); List<AnnotationBuilder> l = (List<AnnotationBuilder>) value; for (Iterator<AnnotationBuilder> i = l.iterator(); i.hasNext();) { AnnotationBuilder ab = i.next(); sb.append(ab.toString()); if (i.hasNext()) sb.append(", "); } sb.append("}"); } else if (value instanceof Class) { String cls = ((Class) value).getName().replace('$', '.'); sb.append(cls).append(".class"); } else if (value instanceof String) { sb.append('"').append(value).append('"'); } else if (value instanceof Enum) { sb.append(AnnotationBuilder.enumToString((Enum) value)); } else if (value instanceof EnumSet) { sb.append(AnnotationBuilder.enumSetToString((EnumSet) value)); } else { sb.append(value); } }
if (col.getName() != null && (null == fmd || !col.getName().equalsIgnoreCase(fmd.getName()))) abCol.add("name", col.getName()); if (col.getTypeName() != null) abCol.add("columnDefinition", col.getTypeName()); if (col.getTarget() != null && (type == ColType.JOIN || type == ColType.INVERSE || type == ColType.PK_JOIN)) abCol.add("referencedColumnName", col.getTarget()); if (type == ColType.COL || type == ColType.JOIN || type == ColType.PK_JOIN) { if (unique) abCol.add("unique", true); if (col.isNotNull()) abCol.add("nullable", false); if (col.getFlag(Column.FLAG_UNINSERTABLE)) abCol.add("insertable", false); if (col.getFlag(Column.FLAG_UNUPDATABLE)) abCol.add("updatable", false); if (secondary != null) abCol.add("table", secondary); abCol.add("length", col.getSize()); if (col.getDecimalDigits() != 0) abCol.add("scale", col.getDecimalDigits()); if (type != ColType.COL || abCol.hasComponents()) { if (null != ab) { String key = null;
@SuppressWarnings("unchecked") public AnnotationBuilder add(String key, AnnotationBuilder val) { if (null == val) return this; AnnotationEntry ae = find(key); if (null == ae) { doAdd(key, val); } else { List<AnnotationBuilder> list; if (ae.value instanceof List) { list = (List<AnnotationBuilder>) ae.value; } else if (ae.value instanceof AnnotationBuilder) { list = new ArrayList<AnnotationBuilder> (); list.add((AnnotationBuilder) ae.value); ae.value = list; } else { throw new IllegalArgumentException( "Unexpected type: " + ae.value); } list.add(val); } return this; }
@SuppressWarnings("unchecked") void toString(StringBuilder sb) { if (null != key) sb.append(key).append("="); List.class.getTypeParameters(); if (value instanceof List) { sb.append("{"); List<AnnotationBuilder> l = (List<AnnotationBuilder>) value; for (Iterator<AnnotationBuilder> i = l.iterator(); i.hasNext();) { AnnotationBuilder ab = i.next(); sb.append(ab.toString()); if (i.hasNext()) sb.append(", "); } sb.append("}"); } else if (value instanceof Class) { String cls = ((Class) value).getName().replace('$', '.'); sb.append(cls).append(".class"); } else if (value instanceof String) { sb.append('"').append(value).append('"'); } else if (value instanceof Enum) { sb.append(AnnotationBuilder.enumToString((Enum) value)); } else if (value instanceof EnumSet) { sb.append(AnnotationBuilder.enumSetToString((EnumSet) value)); } else { sb.append(value); } }
if (col.getName() != null && (null == fmd || !col.getName().equalsIgnoreCase(fmd.getName()))) abCol.add("name", col.getName()); if (col.getTypeName() != null) abCol.add("columnDefinition", col.getTypeName()); if (col.getTarget() != null && (type == ColType.JOIN || type == ColType.INVERSE || type == ColType.PK_JOIN)) abCol.add("referencedColumnName", col.getTarget()); if (type == ColType.COL || type == ColType.JOIN || type == ColType.PK_JOIN) { if (unique) abCol.add("unique", true); if (col.isNotNull()) abCol.add("nullable", false); if (col.getFlag(Column.FLAG_UNINSERTABLE)) abCol.add("insertable", false); if (col.getFlag(Column.FLAG_UNUPDATABLE)) abCol.add("updatable", false); if (secondary != null) abCol.add("table", secondary); abCol.add("length", col.getSize()); if (col.getDecimalDigits() != 0) abCol.add("scale", col.getDecimalDigits()); if (type != ColType.COL || abCol.hasComponents()) { if (null != ab) { String key = null;
@SuppressWarnings("unchecked") public AnnotationBuilder add(String key, AnnotationBuilder val) { if (null == val) return this; AnnotationEntry ae = find(key); if (null == ae) { doAdd(key, val); } else { List<AnnotationBuilder> list; if (ae.value instanceof List) { list = (List<AnnotationBuilder>) ae.value; } else if (ae.value instanceof AnnotationBuilder) { list = new ArrayList<AnnotationBuilder> (); list.add((AnnotationBuilder) ae.value); ae.value = list; } else { throw new IllegalArgumentException( "Unexpected type: " + ae.value); } list.add(val); } return this; }
@SuppressWarnings("unchecked") void toString(StringBuilder sb) { if (null != key) sb.append(key).append("="); List.class.getTypeParameters(); if (value instanceof List) { sb.append("{"); List<AnnotationBuilder> l = (List<AnnotationBuilder>) value; for (Iterator<AnnotationBuilder> i = l.iterator(); i.hasNext();) { AnnotationBuilder ab = i.next(); sb.append(ab.toString()); if (i.hasNext()) sb.append(", "); } sb.append("}"); } else if (value instanceof Class) { String cls = ((Class) value).getName().replace('$', '.'); sb.append(cls).append(".class"); } else if (value instanceof String) { sb.append('"').append(value).append('"'); } else if (value instanceof Enum) { sb.append(AnnotationBuilder.enumToString((Enum) value)); } else if (value instanceof EnumSet) { sb.append(AnnotationBuilder.enumSetToString((EnumSet) value)); } else { sb.append(value); } }
if (col.getName() != null && (null == fmd || !col.getName().equalsIgnoreCase(fmd.getName()))) abCol.add("name", col.getName()); if (col.getTypeName() != null) abCol.add("columnDefinition", col.getTypeName()); if (col.getTarget() != null && (type == ColType.JOIN || type == ColType.INVERSE || type == ColType.PK_JOIN)) abCol.add("referencedColumnName", col.getTarget()); if (type == ColType.COL || type == ColType.JOIN || type == ColType.PK_JOIN) { if (unique) abCol.add("unique", true); if (col.isNotNull()) abCol.add("nullable", false); if (col.getFlag(Column.FLAG_UNINSERTABLE)) abCol.add("insertable", false); if (col.getFlag(Column.FLAG_UNUPDATABLE)) abCol.add("updatable", false); if (secondary != null) abCol.add("table", secondary); abCol.add("length", col.getSize()); if (col.getDecimalDigits() != 0) abCol.add("scale", col.getDecimalDigits()); if (type != ColType.COL || abCol.hasComponents()) { if (null != ab) { String key = null;
public AnnotationBuilder add(String key, boolean val) { return doAdd(key, val); }
@SuppressWarnings("unchecked") public AnnotationBuilder add(String key, AnnotationBuilder val) { if (null == val) return this; AnnotationEntry ae = find(key); if (null == ae) { doAdd(key, val); } else { List<AnnotationBuilder> list; if (ae.value instanceof List) { list = (List<AnnotationBuilder>) ae.value; } else if (ae.value instanceof AnnotationBuilder) { list = new ArrayList<AnnotationBuilder> (); list.add((AnnotationBuilder) ae.value); ae.value = list; } else { throw new IllegalArgumentException( "Unexpected type: " + ae.value); } list.add(val); } return this; }
public String toString() { StringBuilder sb = new StringBuilder(); toString(sb); return sb.toString(); }
/** * Creates a new annotation builder for the specified annotation type. */ protected AnnotationBuilder newAnnotationBuilder( Class<? extends Annotation> annType) { return new AnnotationBuilder(annType); }
@SuppressWarnings("unchecked") void toString(StringBuilder sb) { if (null != key) sb.append(key).append("="); List.class.getTypeParameters(); if (value instanceof List) { sb.append("{"); List<AnnotationBuilder> l = (List<AnnotationBuilder>) value; for (Iterator<AnnotationBuilder> i = l.iterator(); i.hasNext();) { AnnotationBuilder ab = i.next(); sb.append(ab.toString()); if (i.hasNext()) sb.append(", "); } sb.append("}"); } else if (value instanceof Class) { String cls = ((Class) value).getName().replace('$', '.'); sb.append(cls).append(".class"); } else if (value instanceof String) { sb.append('"').append(value).append('"'); } else if (value instanceof Enum) { sb.append(AnnotationBuilder.enumToString((Enum) value)); } else if (value instanceof EnumSet) { sb.append(AnnotationBuilder.enumSetToString((EnumSet) value)); } else { sb.append(value); } }