Skip to content

Commit

Permalink
No need to check for invalid XML now that we're doing validation
Browse files Browse the repository at this point in the history
  • Loading branch information
johncurrier committed Aug 24, 2008
1 parent 0ce0f2f commit 60f369a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
7 changes: 0 additions & 7 deletions src/net/sourceforge/schemaspy/model/xml/ForeignKeyMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,16 @@ public class ForeignKeyMeta {
if (node == null)
throw new IllegalStateException("XML foreignKey definition requires 'table' attribute");
tableName = node.getNodeValue();
attribs.removeNamedItem("table");
node = attribs.getNamedItem("column");
if (node == null)
throw new IllegalStateException("XML foreignKey definition requires 'column' attribute");
columnName = node.getNodeValue();
attribs.removeNamedItem("column");
node = attribs.getNamedItem("remoteSchema");
if (node != null) {
remoteSchema = node.getNodeValue();
attribs.removeNamedItem("remoteSchema");
} else {
remoteSchema = null;
}

for (int i = 0; i < attribs.getLength(); ++i) {
System.err.println("Unrecognized attribute '" + attribs.item(i).getNodeName() + "' in XML definition of foreignKey");
}
}

public String getTableName() {
Expand Down
10 changes: 0 additions & 10 deletions src/net/sourceforge/schemaspy/model/xml/TableColumnMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,17 @@ public class TableColumnMeta {
String tmp;

name = attribs.getNamedItem("name").getNodeValue();
attribs.removeNamedItem("name");
Node node = attribs.getNamedItem("comments");
if (node != null) {
tmp = node.getNodeValue().trim();
comments = tmp.length() == 0 ? null : tmp;
attribs.removeNamedItem("comments");
} else {
comments = null;
}

node = attribs.getNamedItem("primaryKey");
if (node != null) {
isPrimary = evalBoolean(node.getNodeValue());
attribs.removeNamedItem("primaryKey");
} else {
isPrimary = false;
}
Expand All @@ -58,16 +55,13 @@ public class TableColumnMeta {
System.err.println(" Valid values include 'to', 'from' and 'all'");
isImpliedChildrenDisabled = isImpliedParentsDisabled = false;
}

attribs.removeNamedItem("disableImpliedKeys");
} else {
isImpliedChildrenDisabled = isImpliedParentsDisabled = false;
}

node = attribs.getNamedItem("disableDiagramAssociations");
if (node != null) {
isExcluded = evalBoolean(node.getNodeValue());
attribs.removeNamedItem("disableDiagramAssociations");
} else {
isExcluded = false;
}
Expand All @@ -78,10 +72,6 @@ public class TableColumnMeta {
Node fkNode = fkNodes.item(i);
foreignKeys.add(new ForeignKeyMeta(fkNode));
}

for (int i = 0; i < attribs.getLength(); ++i) {
System.err.println("Unrecognized attribute '" + attribs.item(i).getNodeName() + "' in XML definition of column '" + name + '\'');
}
}

private boolean evalBoolean(String exp) {
Expand Down
7 changes: 0 additions & 7 deletions src/net/sourceforge/schemaspy/model/xml/TableMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,17 @@ public class TableMeta {
NamedNodeMap attribs = tableNode.getAttributes();

name = attribs.getNamedItem("name").getNodeValue();
attribs.removeNamedItem("name");

Node commentNode = attribs.getNamedItem("comments");
if (commentNode != null) {
String tmp = commentNode.getNodeValue().trim();
comments = tmp.length() == 0 ? null : tmp;
attribs.removeNamedItem("comments");
} else {
comments = null;
}

Node remoteSchemaNode = attribs.getNamedItem("remoteSchema");
if (remoteSchemaNode != null) {
attribs.removeNamedItem("remoteSchema");
remoteSchema = remoteSchemaNode.getNodeValue().trim();
} else {
remoteSchema = null;
Expand All @@ -45,10 +42,6 @@ public class TableMeta {
Node colNode = columnNodes.item(i);
columns.add(new TableColumnMeta(colNode));
}

for (int i = 0; i < attribs.getLength(); ++i) {
System.err.println("Unrecognized attribute '" + attribs.item(i).getNodeName() + "' in XML definition of table '" + name + '\'');
}
}

public String getName() {
Expand Down

0 comments on commit 60f369a

Please sign in to comment.