protected void copyDeepInfoInto(OJAnnotationValue result) { super.copyDeepInfoInto(result); result.type = type.getDeepCopy(); result.attributes = new TreeMap<String, OJAnnotationAttributeValue>(); for (OJAnnotationAttributeValue v : this.attributes.values()) { result.attributes.put(v.getName(), v.getDeepCopy()); } }
@Override public void addTypesUsed(Set<OJPathName> s) { if (isImportType()) { s.add(this.type); } super.addTypesUsed(s); for (OJAnnotationAttributeValue o : this.attributes.values()) { o.addTypesUsed(s); } }
@Override public String toJavaString() { String referencedName = isImportType() ? this.type.getLast() : this.type.toJavaString(); if (this.attributes.isEmpty() && super.values.size() > 0) { return "@" + referencedName + "(" + super.toJavaValueExpression() + ")"; } else if (this.attributes.size() > 0) { StringBuilder sb = new StringBuilder(); sb.append("@"); sb.append(referencedName); sb.append("("); Iterator<OJAnnotationAttributeValue> a = this.attributes.values().iterator(); while (a.hasNext()) { OJMetaValue attr = a.next(); sb.append(attr.toJavaString()); if (a.hasNext()) { sb.append(","); } } sb.append(")"); return sb.toString(); } else { return "@" + referencedName; } }
public OJAnnotationValue(OJPathName type, OJEnumValue value) { super(value); super.setName(type.getLast()); this.type = type; }
public void renameAll(Set<OJPathName> renamePathNames, String newName) { super.renameAll(renamePathNames, newName); for (OJAnnotationAttributeValue attr : this.attributes.values()) { attr.renameAll(renamePathNames, newName); } }