View Javadoc

1   package org.andromda.schema2xmi;
2   
3   
4   /***
5    * Contains utilities for the Schema2XMI tool.
6    *
7    * @author Chad Brandon
8    */
9   class Schema2XMIUtils
10  {
11      /***
12       * Constructs the entire type name from the
13       * given name and length.
14       *
15       * @param name the name of the type
16       * @param length the length of the type.
17       * @return the type name with the length.
18       */
19      static String constructTypeName(
20          final String name,
21          final String length)
22      {
23          final StringBuffer buffer = new StringBuffer();
24          if (name != null)
25          {
26              buffer.append(name);
27          }
28          if (name != null && length != null && !name.matches(".+//(.+//)"))
29          {
30              buffer.append("(" + length + ")");
31          }
32          return buffer.toString();
33      }
34  }