01: package org.andromda.schema2xmi;
02:
03: /**
04: * Contains utilities for the Schema2XMI tool.
05: *
06: * @author Chad Brandon
07: */
08: class Schema2XMIUtils {
09: /**
10: * Constructs the entire type name from the
11: * given name and length.
12: *
13: * @param name the name of the type
14: * @param length the length of the type.
15: * @return the type name with the length.
16: */
17: static String constructTypeName(final String name,
18: final String length) {
19: final StringBuffer buffer = new StringBuffer();
20: if (name != null) {
21: buffer.append(name);
22: }
23: if (name != null && length != null
24: && !name.matches(".+\\(.+\\)")) {
25: buffer.append("(" + length + ")");
26: }
27: return buffer.toString();
28: }
29: }
|