prefixValue = pn;
}
public String toString(){
StringBuffer xml = new StringBuffer();
SEXParser sp = new SEXParser();
sp.addOpenNodeName("tableinfo",xml);
//.addLineFeed(xml);
sp.addOpenNodeName("name",xml);
xml.append(getName());
sp.addCloseNodeName("name",xml);
sp.addOpenNodeName("prefix",xml);
xml.append(prefix);
sp.addCloseNodeName("prefix",xml);
sp.addOpenNodeName("tableleafs",xml);
xml.append(tableleafs);
sp.addCloseNodeName("tableleafs",xml);
sp.addOpenNodeName("prefix_value",xml);
xml.append(prefixValue);
sp.addCloseNodeName("prefix_value",xml);
if (primarykeys.size() > 0)
{
sp.addOpenNodeName("primarykeys",xml);
xml.append(primarykeys.toDelimitedString(";"));
sp.addCloseNodeName("primarykeys",xml);
}
if (autoincrement.size() > 0)
{
sp.addOpenNodeName("autoincrements",xml);
xml.append(autoincrement.toDelimitedString(";"));
sp.addCloseNodeName("autoincrements",xml);
}
if (fieldList.size() > 0)
{
sp.addOpenNodeName("fieldList",xml);
xml.append(fieldList.toDelimitedString(";"));
sp.addCloseNodeName("fieldList",xml);
}
//(getName() + " notnulls " + notnulls);
if (notnulls.size() > 0)
{
sp.addOpenNodeName("notnulls",xml);
xml.append(notnulls.toDelimitedString(";"));
sp.addCloseNodeName("notnulls",xml);
}
if (constraints.size() > 0)
{
sp.addOpenNodeName("constraints",xml);
//.addLineFeed(xml);
Enumeration en = constraints.keys();
while (en.hasMoreElements())
{
String jn = (String)en.nextElement();
jiqlConstraint jc = (jiqlConstraint)constraints.get(jn);
sp.addOpenNodeName("constraint",xml);
//.addLineFeed(xml);
sp.addOpenNodeName("name",xml);
xml.append(jn);
sp.addCloseNodeName("name",xml);
//.addLineFeed(xml);
sp.addOpenNodeName("type",xml);
xml.append(jc.getType());
sp.addCloseNodeName("type",xml);
//.addLineFeed(xml);
sp.addOpenNodeName("target",xml);
xml.append(jc.toDelimitedString(";"));
sp.addCloseNodeName("target",xml);
//.addLineFeed(xml);
jiqlFunction jref = jc.getReference();
if (jref != null)
{
sp.addOpenNodeName("references",xml);
//.addLineFeed(xml);
sp.addOpenNodeName("name",xml);
xml.append(jref.getName());
sp.addCloseNodeName("name",xml);
//.addLineFeed(xml);
sp.addOpenNodeName("target",xml);
xml.append(jref.toDelimitedString(";"));
sp.addCloseNodeName("target",xml);
//.addLineFeed(xml);
sp.addCloseNodeName("references",xml);
//.addLineFeed(xml);
}
sp.addCloseNodeName("constraint",xml);
//.addLineFeed(xml);
}
sp.addCloseNodeName("constraints",xml);
}
if (defaultValues.size() > 0)
{
sp.addOpenNodeName("defaultvalues",xml);
//.addLineFeed(xml);
Enumeration en = defaultValues.keys();
while (en.hasMoreElements())
{
String jn = (String)en.nextElement();
Object jc = defaultValues.get(jn);
sp.addOpenNodeName("defaultvalue",xml);
//.addLineFeed(xml);
sp.addOpenNodeName("field",xml);
xml.append(jn);
sp.addCloseNodeName("field",xml);
//.addLineFeed(xml);
sp.addOpenNodeName("value",xml);
xml.append(jc.toString());
sp.addCloseNodeName("value",xml);
//.addLineFeed(xml);
sp.addCloseNodeName("defaultvalue",xml);
//.addLineFeed(xml);
}
sp.addCloseNodeName("defaultvalues",xml);
}
sp.addCloseNodeName("tableinfo",xml);
return xml.toString();
}