WriteThisMethod - Write this method for this class.
@param codeType Interface only
976329
public void writeThisMethod(CodeType codeType)
    {
        Record recClassInfo = this.getMainRecord();
        LogicFile recLogicFile = (LogicFile)this.getRecord(LogicFile.LOGIC_FILE_FILE);
        String strClassName = recClassInfo.getField(ClassInfo.CLASS_NAME).getString();
        MethodInfo methodInfo = new MethodInfo();
        m_MethodHelper.getTheMethodInfo(recLogicFile, methodInfo);   // Get the correct interface, etc..
        String strMethodName = recLogicFile.getField(LogicFile.METHOD_NAME).getString();
        String strMethodDesc = recLogicFile.getField(LogicFile.LOGIC_DESCRIPTION).getString();
        String strProtection = recLogicFile.getField(LogicFile.PROTECTION).getString();
        if (m_MethodNameList.addName(strMethodName) == false)
            return;     // Don't write it, its already here
        if (strMethodName.length() > 2) if (strMethodName.charAt(strMethodName.length() - 2) == '*')
            strMethodName = strMethodName.substring(0, strMethodName.length() - 2);
        if (strMethodName.equals(strClassName))
        {
            if (codeType == CodeType.THICK)
            {
                if ("".equalsIgnoreCase(methodInfo.strMethodInterface))
                    return;    // Default constructor is already there
                this.writeMethodInterface(strProtection, strMethodName, "", methodInfo.strMethodInterface, methodInfo.strMethodThrows, strMethodDesc, null);
                this.writeDefaultMethodCode(strMethodName, methodInfo.strMethodReturns, methodInfo.strMethodInterface, strClassName);
            }
        }
        else
        {
            if (methodInfo.strMethodReturns.length() >= 7) if (methodInfo.strMethodReturns.substring(methodInfo.strMethodReturns.length() - 7, methodInfo.strMethodReturns.length()).equalsIgnoreCase("  "))
                methodInfo.strMethodReturns = methodInfo.strMethodReturns.substring(0, methodInfo.strMethodReturns.length() - 6);
            String strCodeBody = null;
            if ((codeType == CodeType.INTERFACE) || ("interface".equals(recClassInfo.getField(ClassInfo.CLASS_TYPE).toString())))
            {
                if (!((IncludeScopeField)recLogicFile.getField(LogicFile.INCLUDE_SCOPE)).includeThis(CodeType.INTERFACE, false))
                    return;
                strCodeBody = ";\n";
            }
            else if (!((IncludeScopeField)recLogicFile.getField(LogicFile.INCLUDE_SCOPE)).includeThis(codeType, false))
            {   // Special case - write a default impl.
                if ((methodInfo.strMethodReturns == null) || ("void".equals(methodInfo.strMethodReturns)) || (DBConstants.BLANK.equals(methodInfo.strMethodReturns)))
                    strCodeBody = "{\n\t// Empty implementation\n}\n";
                else if ("boolean".equals(methodInfo.strMethodReturns))
                    strCodeBody = "{\n\treturn false; // Empty implementation\n}\n";
                else if (("int".equals(methodInfo.strMethodReturns)) || ("short".equals(methodInfo.strMethodReturns)) || ("long".equals(methodInfo.strMethodReturns)))
                    strCodeBody = "{\n\treturn -1; // Empty implementation\n}\n";
                else
                    strCodeBody = "{\n\treturn null; // Empty implementation\n}\n";
            }
            this.writeMethodInterface(strProtection, strMethodName, methodInfo.strMethodReturns, methodInfo.strMethodInterface, methodInfo.strMethodThrows, strMethodDesc, strCodeBody);
        }
        if ((codeType == CodeType.INTERFACE) || ("interface".equals(recClassInfo.getField(ClassInfo.CLASS_TYPE).toString())))
            return;
        if (!((IncludeScopeField)recLogicFile.getField(LogicFile.INCLUDE_SCOPE)).includeThis(codeType, false))
            return;
        if (!strMethodName.equals(strClassName))
        {
            if (recLogicFile.getField(LogicFile.LOGIC_SOURCE).getString().length() != 0)
            {
                String strBaseClass;
                strBaseClass = recClassInfo.getField(ClassInfo.BASE_CLASS_NAME).getString();
                m_StreamOut.setTabs(+1);
                this.writeTextField(recLogicFile.getField(LogicFile.LOGIC_SOURCE), strBaseClass, strMethodName, methodInfo.strMethodInterface, strClassName);
                m_StreamOut.setTabs(-1);
            }
            else
                this.writeDefaultMethodCode(strMethodName, methodInfo.strMethodReturns, methodInfo.strMethodInterface, strClassName);
        }
        m_StreamOut.writeit("}\n");
    }
256653
private void writeSimple(String currentIndent, String tagName, StringBuilder attrs, Class<?> declaredType, Object value) throws IOException {
        Class<?> effectiveType;
        if (declaredType == Object.class) {
            Class<?> realType = value.getClass();
            if (realType != String.class) {
                effectiveType = settings.getConverter().findTypedConverter(realType).getEffectiveType();
                String typeStr = SerTypeMapper.encodeType(effectiveType, settings, basePackage, knownTypes);
                appendAttribute(attrs, TYPE, typeStr);
            } else {
                effectiveType = realType;
            }
        } else if (settings.getConverter().isConvertible(declaredType) == false) {
            effectiveType = settings.getConverter().findTypedConverter(value.getClass()).getEffectiveType();
            String typeStr = SerTypeMapper.encodeType(effectiveType, settings, basePackage, knownTypes);
            appendAttribute(attrs, TYPE, typeStr);
        } else {
            effectiveType = declaredType;
        }
        try {
            String converted = settings.getConverter().convertToString(effectiveType, value);
            if (converted == null) {
                throw new IllegalArgumentException("Unable to write because converter returned a null string: " + value);
            }
            output.append(currentIndent).append('<').append(tagName).append(attrs).append('>');
            appendEncoded(converted);
            output.append('<').append('/').append(tagName).append('>').append(settings.getNewLine());
        } catch (RuntimeException ex) {
            throw new IllegalArgumentException("Unable to convert type " + effectiveType.getName() + " declared as " + declaredType.getName(), ex);
        }
    }
425785
public void writeClassInterface()
    {
        Record recClassInfo = this.getMainRecord();
        String strClassName = recClassInfo.getField(ClassInfo.CLASS_NAME).getString();
        String strBaseClass = recClassInfo.getField(ClassInfo.BASE_CLASS_NAME).getString();
        String strClassDesc = recClassInfo.getField(ClassInfo.CLASS_DESC).getString();
        String strClassInterface = recClassInfo.getField(ClassInfo.CLASS_IMPLEMENTS).getString();
        String implementsClass = null;
        if (((ClassInfo)recClassInfo).isARecord(false))
            implementsClass = strClassName + "Model";
        if ((implementsClass != null) && (implementsClass.length() > 0))
        {
            m_IncludeNameList.addInclude(this.getPackage(CodeType.INTERFACE), null);    // Make sure this is included
            if ((strClassInterface == null) || (strClassInterface.length() == 0))
                strClassInterface = implementsClass;
            else
                strClassInterface = implementsClass + ", " + strClassInterface;
        }
        m_IncludeNameList.addInclude(strBaseClass, null);    // Make sure this is included
    
        m_StreamOut.writeit("\n/**\n *\t" + strClassName + " - " + strClassDesc + ".\n */\n");

        if ((strClassInterface == null) || (strClassInterface.length() == 0))
            strClassInterface = "";
        else
            strClassInterface = "\n\t implements " + strClassInterface;
        String strClassType = "class";
        if ("interface".equals(recClassInfo.getField(ClassInfo.CLASS_TYPE).toString()))
            strClassType = "interface";
        String strExtends = " extends ";
        if (strBaseClass.length() == 0)
            strExtends = "";
        m_StreamOut.writeit("public " + strClassType + " " + strClassName + strExtends + strBaseClass + strClassInterface + "\n{\n");
        m_StreamOut.setTabs(+1);
    }
1314873
void writeMethod(MethodSymbol m) {
        int flags = adjustFlags(m.flags());
        databuf.appendChar(flags);
        if (dumpMethodModifiers) {
            PrintWriter pw = log.getWriter(Log.WriterKind.ERROR);
            pw.println("METHOD  " + fieldName(m));
            pw.println("---" + flagNames(m.flags()));
        }
        databuf.appendChar(pool.put(fieldName(m)));
        databuf.appendChar(pool.put(typeSig(m.externalType(types))));
        int acountIdx = beginAttrs();
        int acount = 0;
        if (m.code != null) {
            int alenIdx = writeAttr(names.Code);
            writeCode(m.code);
            m.code = null; // to conserve space
            endAttr(alenIdx);
            acount++;
        }
        List<Type> thrown = m.erasure(types).getThrownTypes();
        if (thrown.nonEmpty()) {
            int alenIdx = writeAttr(names.Exceptions);
            databuf.appendChar(thrown.length());
            for (List<Type> l = thrown; l.nonEmpty(); l = l.tail)
                databuf.appendChar(pool.put(l.head.tsym));
            endAttr(alenIdx);
            acount++;
        }
        if (m.defaultValue != null) {
            int alenIdx = writeAttr(names.AnnotationDefault);
            m.defaultValue.accept(awriter);
            endAttr(alenIdx);
            acount++;
        }
        if (options.isSet(PARAMETERS))
            acount += writeMethodParametersAttr(m);
        acount += writeMemberAttrs(m);
        acount += writeParameterAttrs(m);
        endAttrs(acountIdx, acount);
    }
714711
public final void writeMethod(int access, Method method, ClassVisitor visitor) {
    writeMethodTo(new CodeBuilder(access, method, null, visitor));
  }
847562
public void writeRemote(String type, String url)
        throws IOException
    {
        os.write('r');
        os.write('t');
        printLenString(type);
        os.write('S');
        printLenString(url);
    }
756071
public void writeDefaultMethodCode(String strMethodName, String strMethodReturns, String strMethodInterface, String strClassName)
    {
        String strBaseClass, strMethodVariables = DBConstants.BLANK;
        Record recClassInfo = this.getMainRecord();
        LogicFile recLogicFile = (LogicFile)this.getRecord(LogicFile.LOGIC_FILE_FILE);
        strBaseClass = recClassInfo.getField(ClassInfo.BASE_CLASS_NAME).getString();  // Get the base class name
        strMethodVariables = this.getMethodVariables(strMethodInterface);
        if (strClassName.equals(strMethodName))
        { // Call super.NewC initializer
            if (strMethodVariables.equalsIgnoreCase("VOID"))
                strMethodVariables = "";
            if (strMethodInterface.length() == 0)
                m_StreamOut.writeit("\tsuper();\n");
            else
            {
                boolean bSuperFound = false;
                if ((strMethodReturns.length() == 0) || (strMethodReturns.equalsIgnoreCase("void")))
                    if (recLogicFile.getField(LogicFile.LOGIC_SOURCE).getLength() > 0)
                        strMethodReturns =  strMethodVariables;   // Special case - if you have code, pass the default variables
                if ((strMethodReturns.length() == 0) || (strMethodReturns.equalsIgnoreCase("void")))
                    m_StreamOut.writeit("\tthis();\n\tthis.init(" + strMethodVariables + ");\n");
                else
                {   // Special Case - Different variables are passed in, must supply and init method w/the correct interface
                    if (!strMethodReturns.equalsIgnoreCase("INIT"))
                    {
                        m_StreamOut.writeit("\tthis();\n\tthis.init(" + strMethodVariables + ");\n");
                        m_StreamOut.writeit("}\n");
                        m_strLastMethodInterface = strMethodInterface;
                        m_strLastMethod = strMethodName;
                        this.writeMethodInterface(null, "init", "void", strMethodInterface, "", "Initialize class fields", null);                   
                        if (strMethodReturns.equalsIgnoreCase("VOID"))
                            strMethodReturns = "";
                        this.writeClassInitialize(true);
                    }
                    else
                        bSuperFound = true; // Don't call init.super();
                    if (recLogicFile.getField(LogicFile.LOGIC_SOURCE).getString().length() != 0)
                    {
                        m_StreamOut.setTabs(+1);
//x                     bSuperFound = m_MethodsOut.writeit(recLogicFile.getField(LogicFile.LOGIC_SOURCE).getString() + "\n");
                        bSuperFound = bSuperFound | this.writeTextField(recLogicFile.getField(LogicFile.LOGIC_SOURCE), strBaseClass, "init", strMethodReturns, strClassName);
                        m_StreamOut.setTabs(-1);
                    }
                    if (!bSuperFound)
                        m_StreamOut.writeit("\tsuper.init(" + strMethodReturns + ");\n");
                }
            }
        }
        else
        { // Call super.NewC
            if (!strMethodName.equals("setupSFields"))
            {
                String beginString = "";
                if (strMethodReturns.length() == 0)
                    beginString = "return ";
                m_StreamOut.writeit("\t" + beginString + "super." + strMethodName + "(" + strMethodVariables + ");\n");
            }
        else
            this.writeSetupSCode(strMethodName, strMethodReturns, strMethodInterface, strClassName);
        }
    }
348477
public void write(EnumType type) throws XMLStreamException {

        LOG.debug("Writing type {} of type {}", type.getName(), type.getMetaType());

        xmlWriter.writeStartElement(ENUM_TYPE);
        xmlWriter.writeAttribute(NAME, type.getName());
        for (EnumMember member : type.getMembers()) {
            xmlWriter.writeStartElement(ENUM_MEMBER);
            xmlWriter.writeAttribute(NAME, member.getName());
            xmlWriter.writeEndElement();
        }
        xmlWriter.writeEndElement();
    }
821454
private void writeSimple(Class<?> declaredType, Object value) throws IOException {
        Class<?> realType = value.getClass();
        if (realType == Integer.class) {
            output.writeInt(((Integer) value).intValue());
        } else if (realType == Long.class) {
            output.writeLong(((Long) value).longValue());
        } else if (realType == Short.class) {
            output.writeInt(((Short) value).shortValue());
        } else if (realType == Byte.class) {
            output.writeInt(((Byte) value).byteValue());
        } else if (realType == Float.class) {
            float flt = ((Float) value).floatValue();
            if (Float.isNaN(flt)) {
                // write as string
                output.writeNull();
            } else if (Float.isInfinite(flt)) {
                // write as string
                output.writeString(Float.toString(flt));
            } else {
                output.writeFloat(flt);
            }
        } else if (realType == Double.class) {
            double dbl = ((Double) value).doubleValue();
            if (Double.isNaN(dbl)) {
                // write as string
                output.writeNull();
            } else if (Double.isInfinite(dbl)) {
                // write as string
                output.writeString(Double.toString(dbl));
            } else {
                output.writeDouble(dbl);
            }
        } else if (realType == Boolean.class) {
            output.writeBoolean(((Boolean) value).booleanValue());
        } else {
            // write as a string
            try {
                String converted = settings.getConverter().convertToString(realType, value);
                if (converted == null) {
                    throw new IllegalArgumentException("Unable to write because converter returned a null string: " + value);
                }
                output.writeString(converted);
            } catch (RuntimeException ex) {
                throw new IllegalArgumentException(
                        "Unable to convert type " + declaredType.getName() + " for real type: " + realType.getName(), ex);
            }
        }
    }
935247
public void write(Object object, OutputStream os, MediaType mediaType)
            throws IOException {
        XStream xstream = getXStreamInstance(mediaType);
        if (xstream != null) {
            xstream.toXML(object, os);
        } else {
            throw new IllegalArgumentException("Content-type: "
                    + mediaType.getType() + " is currently not supported for "
                    + object.getClass().getName());
        }
    }
307073
private void writeMethod(Definition def, Writer out, int indent) throws IOException
   {
      if (def.getMcfDefs().get(getNumOfMcf()).isDefineMethodInConnection())
      {
         if (def.getMcfDefs().get(getNumOfMcf()).getMethods().size() > 0)
         {
            for (MethodForConnection method : def.getMcfDefs().get(getNumOfMcf()).getMethods())
            {
               writeMethodSignature(out, indent, method);
               writeLeftCurlyBracket(out, indent);
               writeLogging(def, out, indent + 1, "trace", method.getMethodName());

               if (!method.getReturnType().equals("void"))
               {
                  writeEol(out);
                  if (BasicType.isPrimitiveType(method.getReturnType()))
                  {
                     writeWithIndent(out, indent + 1, "return " + BasicType.defaultValue(method.getReturnType()) + ";");
                  }
                  else
                  {
                     writeWithIndent(out, indent + 1, "return null;");
                  }
               }

               writeRightCurlyBracket(out, indent);
            }
         }
      }
      else
      {
         writeSimpleMethodSignature(out, indent, " * Call me", "void callMe()");
         writeLeftCurlyBracket(out, indent);
         writeLogging(def, out, indent + 1, "trace", "callMe");
         writeRightCurlyBracket(out, indent);
      }
   }
920702
public void write(ByteCodeWriter out)
    throws IOException
  {
    out.writeUTF8Const(getName());

    TempOutputStream ts = new TempOutputStream();
    //ts.openWrite();
    //WriteStream ws = new WriteStream(ts);
    ByteCodeWriter o2 = new ByteCodeWriter(ts, out.getJavaClass());
    
    o2.writeShort(_maxStack);
    o2.writeShort(_maxLocals);
    o2.writeInt(_code.length);
    o2.write(_code, 0, _code.length);

    o2.writeShort(_exceptions.size());
    for (int i = 0; i < _exceptions.size(); i++) {
      ExceptionItem exn = _exceptions.get(i);

      o2.writeShort(exn.getStart());
      o2.writeShort(exn.getEnd());
      o2.writeShort(exn.getHandler());
      o2.writeShort(exn.getType());
    }

    o2.writeShort(_attributes.size());
    for (int i = 0; i < _attributes.size(); i++) {
      Attribute attr = _attributes.get(i);

      attr.write(o2);
    }
    
    //ws.close();
    
    out.writeInt(ts.getLength());
    TempBuffer ptr = ts.getHead();

    for (; ptr != null; ptr = ptr.next())
      out.write(ptr.buffer(), 0, ptr.length());

    ts.destroy();
  }
191044
public static void writeObject(CodedOutputStream out, int order, FieldType type, Object o, boolean list)
            throws IOException {
        if (o == null) {
            return;
        }

        if (type == FieldType.OBJECT) {

            Class cls = o.getClass();
            Codec target = ProtobufProxy.create(cls);

            out.writeRawVarint32(makeTag(order, WireFormat.WIRETYPE_LENGTH_DELIMITED));
            out.writeRawVarint32(target.size(o));

            target.writeTo(o, out);
            return;
        }

        if (type == FieldType.BOOL) {
            out.writeBool(order, (Boolean) o);
        } else if (type == FieldType.BYTES) {
            byte[] bb = (byte[]) o;
            out.writeBytes(order, ByteString.copyFrom(bb));
        } else if (type == FieldType.DOUBLE) {
            out.writeDouble(order, (Double) o);
        } else if (type == FieldType.FIXED32) {
            out.writeFixed32(order, (Integer) o);
        } else if (type == FieldType.FIXED64) {
            out.writeFixed64(order, (Long) o);
        } else if (type == FieldType.FLOAT) {
            out.writeFloat(order, (Float) o);
        } else if (type == FieldType.INT32) {
            out.writeInt32(order, (Integer) o);
        } else if (type == FieldType.INT64) {
            out.writeInt64(order, (Long) o);
        } else if (type == FieldType.SFIXED32) {
            out.writeSFixed32(order, (Integer) o);
        } else if (type == FieldType.SFIXED64) {
            out.writeSFixed64(order, (Long) o);
        } else if (type == FieldType.SINT32) {
            out.writeSInt32(order, (Integer) o);
        } else if (type == FieldType.SINT64) {
            out.writeSInt64(order, (Long) o);
        } else if (type == FieldType.STRING) {
            out.writeBytes(order, ByteString.copyFromUtf8(String.valueOf(o)));
        } else if (type == FieldType.UINT32) {
            out.writeUInt32(order, (Integer) o);
        } else if (type == FieldType.UINT64) {
            out.writeUInt64(order, (Long) o);
        } else if (type == FieldType.ENUM) {
            int value = 0;
            if (o instanceof EnumReadable) {
                value = ((EnumReadable) o).value();
            } else if (o instanceof Enum) {
                value = ((Enum) o).ordinal();
            }
            out.writeEnum(order, value);
        }
    }
303852
void write(ByteCodeWriter out)
    throws IOException
  {
    out.write(ConstantPool.CP_UTF8);
    out.writeUTF8(_value);
  }
100093
private void writeSimple(Class<?> declaredType, Object value) throws IOException {
        // simple types have no need to write a type object
        Class<?> realType = value.getClass();
        if (realType == Integer.class) {
            output.writeInt(((Integer) value).intValue());
            return;
        } else if (realType == Double.class) {
            double dbl = ((Double) value).doubleValue();
            if (Double.isNaN(dbl) == false && Double.isInfinite(dbl) == false) {
                output.writeDouble(dbl);
                return;
            }
        } else if (realType == Boolean.class) {
            output.writeBoolean(((Boolean) value).booleanValue());
            return;
        }
        
        // handle no declared type and subclasses
        Class<?> effectiveType = declaredType;
        boolean requiresClose = false;
        if (declaredType == Object.class) {
            if (realType != String.class) {
                effectiveType = settings.getConverter().findTypedConverter(realType).getEffectiveType();
                String typeStr = SerTypeMapper.encodeType(effectiveType, settings, basePackage, knownTypes);
                output.writeObjectStart();
                output.writeObjectKeyValue(TYPE, typeStr);
                output.writeObjectKey(VALUE);
                requiresClose = true;
            } else {
                effectiveType = realType;
            }
        } else if (settings.getConverter().isConvertible(declaredType) == false) {
            effectiveType = settings.getConverter().findTypedConverter(realType).getEffectiveType();
            String typeStr = SerTypeMapper.encodeType(effectiveType, settings, basePackage, knownTypes);
            output.writeObjectStart();
            output.writeObjectKeyValue(TYPE, typeStr);
            output.writeObjectKey(VALUE);
            requiresClose = true;
        }
        
        // long/short/byte/float only processed now to ensure that exact numeric type can be identified
        if (realType == Long.class) {
            output.writeLong(((Long) value).longValue());
            
        } else if (realType == Short.class) {
            output.writeInt(((Short) value).shortValue());
            
        } else if (realType == Byte.class) {
            output.writeInt(((Byte) value).byteValue());
            
        } else if (realType == Float.class) {
            output.writeFloat(((Float) value).floatValue());
            
        } else {
            // write as a string
            try {
                String converted = settings.getConverter().convertToString(effectiveType, value);
                if (converted == null) {
                    throw new IllegalArgumentException("Unable to write because converter returned a null string: " + value);
                }
                output.writeString(converted);
            } catch (RuntimeException ex) {
                throw new IllegalArgumentException(
                        "Unable to convert type " + effectiveType.getName() + " declared as " + declaredType.getName(), ex);
            }
        }
        
        // close open map
        if (requiresClose) {
            output.writeObjectEnd();
        }
    }
364464
private void writeTypedBytes(final int type, final byte[] data, final int offset, final int length)
    {
        int totalLength = 1 + length;
        if (length < 14)
        {
            buffer.writeUInt8(type | length);
        }
        else
        {
            // need to specify length explicitly
            buffer.writeUInt8(type | 0xE);
            final int sizeLength = buffer.writeVarUInt(length);
            totalLength += sizeLength;
        }
        updateLength(totalLength);
        buffer.writeBytes(data, offset, length);
    }
1085286
public void writeKeyOffsets(CodeType codeType)
    { // Now, write all the key offsets out
        Record recClassInfo = this.getMainRecord();
        try   {
            //String previousKey;
            String strKeyName = "";
            String strRecordClass;
            String uniqueKeyFields[] = new String[10];
            String uniqueKeySeq[] = new String[10];
            int uniqueKeyCount = 0;
            strRecordClass = recClassInfo.getField(ClassInfo.CLASS_NAME).getString();
            
            Record recKeyInfo = this.getRecord(KeyInfo.KEY_INFO_FILE);
            recKeyInfo.close();
            int count = 0;
            while (recKeyInfo.hasNext())
            {
                recKeyInfo.next();
                count++;
                strKeyName = recKeyInfo.getField(KeyInfo.KEY_NAME).getString();
                if (strKeyName.length() == 0)
                    strKeyName = recKeyInfo.getField(KeyInfo.KEY_FIELD_1).getString();
                if (strKeyName.equalsIgnoreCase(DBConstants.PRIMARY_KEY))
                    strKeyName = strRecordClass + "Primary";    // To avoid re-defining kPrimaryKey

                if (!((IncludeScopeField)recKeyInfo.getField(KeyInfo.INCLUDE_SCOPE)).includeThis(codeType, true))
                    continue;
                if (keyInBase(recClassInfo, recKeyInfo))
                    continue;
                if (!strKeyName.equalsIgnoreCase(DBConstants.PRIMARY_KEY))
                    if (count == 1)
                        if (recKeyInfo.getField(KeyInfo.KEY_NUMBER).isNull())
                            count++;   // Special case, no sequence, first key is not the primary key... first key must be primary key
                if (count > 1)
                    m_StreamOut.writeit("\npublic static final String " + this.convertNameToConstant(strKeyName + "Key") + " = \"" + strKeyName +"\";\n");

                    // This logic here checks to see if this is a unique key with one field, if yes adds field to array
                String keyTypeStr, strKeyFieldName;
                keyTypeStr = recKeyInfo.getField(KeyInfo.KEY_TYPE).getString();
                if (keyTypeStr.length() == 0)
                    keyTypeStr = KeyTypeField.UNIQUE; // Unique key if no selection
                strKeyFieldName = recKeyInfo.getField(KeyInfo.KEY_FIELD_2).getString();
                if (((keyTypeStr.charAt(0) == KeyTypeField.UNIQUE.charAt(0)) || (keyTypeStr.charAt(0) == 'Y')) && (strKeyFieldName.length() == 0))
                    { // Unique key with one field, default logic... always try to read
                    strKeyFieldName = recKeyInfo.getField(KeyInfo.KEY_FIELD_1).getString();
                    uniqueKeyFields[uniqueKeyCount] = strKeyFieldName;
                    uniqueKeySeq[uniqueKeyCount] = strKeyName;
                    uniqueKeyCount++;
                }
            }
            recKeyInfo.close();
        } catch (DBException ex)   {
            ex.printStackTrace();
        }
    }