/** * 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()); }
/** * 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()); }
/** * 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()); }
/** * 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); } }
/** * 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); } }