protected void adjustTypeNames(Map typeNameMap) { adjustInitialValue(typeNameMap); }
/** * Used for calculating imports. @see org.eclipse.persistence.internal.codegen.ClassDefinition#calculateImports() */ protected void putTypeNamesInMap(Map typeNameMap) { putTypeNameInMap(getTypeName(), typeNameMap); for (Iterator i = parseForTypeNames(getInitialValue()).iterator(); i.hasNext();) { putTypeNameInMap((String)i.next(), typeNameMap); } }
/** * Parses the initial value, removing the package name for each type * (and adding the appropriate import) if the type is * unambiguous. */ private void adjustInitialValue(Map typeNameMap) { if (getInitialValue() == null) { return; } StringBuilder initialValue = new StringBuilder(getInitialValue()); Set typeNames = parseForTypeNames(initialValue.toString()); for (Iterator i = typeNames.iterator(); i.hasNext();) { String typeName = (String)i.next(); String adjustedTypeName = adjustTypeName(typeName, typeNameMap); if (!typeName.equals(adjustedTypeName)) { int typeNameStartIndex = initialValue.toString().indexOf(typeName); while (typeNameStartIndex != -1) { initialValue.replace(typeNameStartIndex, typeNameStartIndex + typeName.length(), adjustedTypeName); typeNameStartIndex = initialValue.toString().indexOf(typeName); } } } setInitialValue(initialValue.toString()); }
public void writeBody(CodeGenerator generator) { generator.writeType(getTypeName()); generator.writeType(" "); generator.write(getName()); if (getInitialValue() != null) { generator.write(" = "); generator.write(getInitialValue()); } generator.write(";"); } }
protected void adjustTypeNames(Map typeNameMap) { adjustType(typeNameMap); super.adjustTypeNames(typeNameMap); }
private void addTypeNamesToMap(HashMap typeNameMap) { putTypeNameInMap(getSuperClass(), typeNameMap); for (Iterator i = getInterfaces().iterator(); i.hasNext();) { putTypeNameInMap((String)i.next(), typeNameMap); } for (Iterator i = getAttributes().iterator(); i.hasNext();) { ((AttributeDefinition)i.next()).putTypeNamesInMap(typeNameMap); } for (Iterator i = getMethods().iterator(); i.hasNext();) { ((MethodDefinition)i.next()).putTypeNamesInMap(typeNameMap); } }
/** * Parses the initial value, removing the package name for each type * (and adding the appropriate import) if the type is * unambiguous. */ private void adjustInitialValue(Map typeNameMap) { if (getInitialValue() == null) { return; } StringBuilder initialValue = new StringBuilder(getInitialValue()); Set typeNames = parseForTypeNames(initialValue.toString()); for (Iterator i = typeNames.iterator(); i.hasNext();) { String typeName = (String)i.next(); String adjustedTypeName = adjustTypeName(typeName, typeNameMap); if (!typeName.equals(adjustedTypeName)) { int typeNameStartIndex = initialValue.toString().indexOf(typeName); while (typeNameStartIndex != -1) { initialValue.replace(typeNameStartIndex, typeNameStartIndex + typeName.length(), adjustedTypeName); typeNameStartIndex = initialValue.toString().indexOf(typeName); } } } setInitialValue(initialValue.toString()); }
public void writeBody(CodeGenerator generator) { generator.writeType(getTypeName()); generator.writeType(" "); generator.write(getName()); if (getInitialValue() != null) { generator.write(" = "); generator.write(getInitialValue()); } generator.write(";"); } }
protected void adjustTypeNames(Map typeNameMap) { adjustType(typeNameMap); super.adjustTypeNames(typeNameMap); }
private void addTypeNamesToMap(HashMap typeNameMap) { putTypeNameInMap(getSuperClass(), typeNameMap); for (Iterator i = getInterfaces().iterator(); i.hasNext();) { putTypeNameInMap((String)i.next(), typeNameMap); } for (Iterator i = getAttributes().iterator(); i.hasNext();) { ((AttributeDefinition)i.next()).putTypeNamesInMap(typeNameMap); } for (Iterator i = getMethods().iterator(); i.hasNext();) { ((MethodDefinition)i.next()).putTypeNamesInMap(typeNameMap); } }
/** * Used for calculating imports. @see org.eclipse.persistence.internal.codegen.ClassDefinition#calculateImports() */ protected void putTypeNamesInMap(Map typeNameMap) { putTypeNameInMap(getTypeName(), typeNameMap); for (Iterator i = parseForTypeNames(getInitialValue()).iterator(); i.hasNext();) { putTypeNameInMap((String)i.next(), typeNameMap); } }
/** * Parses the initial value, removing the package name for each type * (and adding the appropriate import) if the type is * unambiguous. */ private void adjustInitialValue(Map typeNameMap) { if (getInitialValue() == null) { return; } StringBuffer initialValue = new StringBuffer(getInitialValue()); Set typeNames = parseForTypeNames(initialValue.toString()); for (Iterator i = typeNames.iterator(); i.hasNext();) { String typeName = (String)i.next(); String adjustedTypeName = adjustTypeName(typeName, typeNameMap); if (!typeName.equals(adjustedTypeName)) { int typeNameStartIndex = initialValue.toString().indexOf(typeName); while (typeNameStartIndex != -1) { initialValue.replace(typeNameStartIndex, typeNameStartIndex + typeName.length(), adjustedTypeName); typeNameStartIndex = initialValue.toString().indexOf(typeName); } } } setInitialValue(initialValue.toString()); }
public void writeBody(CodeGenerator generator) { generator.writeType(getTypeName()); generator.writeType(" "); generator.write(getName()); if (getInitialValue() != null) { generator.write(" = "); generator.write(getInitialValue()); } generator.write(";"); } }
protected void adjustTypeNames(Map typeNameMap) { adjustType(typeNameMap); super.adjustTypeNames(typeNameMap); }
private void addTypeNamesToMap(HashMap typeNameMap) { putTypeNameInMap(getSuperClass(), typeNameMap); for (Iterator i = getInterfaces().iterator(); i.hasNext();) { putTypeNameInMap((String)i.next(), typeNameMap); } for (Iterator i = getAttributes().iterator(); i.hasNext();) { ((AttributeDefinition)i.next()).putTypeNamesInMap(typeNameMap); } for (Iterator i = getMethods().iterator(); i.hasNext();) { ((MethodDefinition)i.next()).putTypeNamesInMap(typeNameMap); } }
protected void adjustTypeNames(Map typeNameMap) { adjustInitialValue(typeNameMap); }
/** * Used for calculating imports. @see org.eclipse.persistence.internal.codegen.ClassDefinition#calculateImports() */ protected void putTypeNamesInMap(Map typeNameMap) { putTypeNameInMap(getTypeName(), typeNameMap); for (Iterator i = parseForTypeNames(getInitialValue()).iterator(); i.hasNext();) { putTypeNameInMap((String)i.next(), typeNameMap); } }
private void adjustTypeNames(HashMap typeNameMap) { setSuperClass(adjustTypeName(getSuperClass(), typeNameMap)); for (Iterator i = new Vector(getInterfaces()).iterator(); i.hasNext();) { String interfaceName = (String)i.next(); replaceInterface(interfaceName, adjustTypeName(interfaceName, typeNameMap)); } for (Iterator i = getAttributes().iterator(); i.hasNext();) { ((AttributeDefinition)i.next()).adjustTypeNames(typeNameMap); } for (Iterator i = getMethods().iterator(); i.hasNext();) { ((MethodDefinition)i.next()).adjustTypeNames(typeNameMap); } }
protected void adjustTypeNames(Map typeNameMap) { adjustInitialValue(typeNameMap); }
private void adjustTypeNames(HashMap typeNameMap) { setSuperClass(adjustTypeName(getSuperClass(), typeNameMap)); for (Iterator i = new Vector(getInterfaces()).iterator(); i.hasNext();) { String interfaceName = (String)i.next(); replaceInterface(interfaceName, adjustTypeName(interfaceName, typeNameMap)); } for (Iterator i = getAttributes().iterator(); i.hasNext();) { ((AttributeDefinition)i.next()).adjustTypeNames(typeNameMap); } for (Iterator i = getMethods().iterator(); i.hasNext();) { ((MethodDefinition)i.next()).adjustTypeNames(typeNameMap); } }