{
Vector fields = new Vector();
Field field;
Node node, name, value, length, format;
NamedNodeMap attributes;
for (int i = 0; i < nodes.getLength(); i++)
{
node = nodes.item(i);
if ((TAG_FIELD.equals(node.getNodeName()))
&& (node.getNodeType() == Node.ELEMENT_NODE))
{
field = new Field();
attributes = node.getAttributes();
name = attributes.getNamedItem(ATTRIBUTE_NAME);
if (name != null)
{
field.name = name.getNodeValue();
}
else
{
throw new XException(Constants.LOCATION_EXTERN,
Constants.LAYER_TECHNICAL,
Constants.PACKAGE_TECHNICAL_AS400, "50");
}
value = attributes.getNamedItem(ATTRIBUTE_VALUE);
if (value != null)
{
field.value = value.getNodeValue();
}
else
{
field.value = null;
}
format = attributes.getNamedItem(ATTRIBUTE_FORMAT);
if (format != null)
{
field.format = format.getNodeValue();
}
else
{
throw new XException(Constants.LOCATION_EXTERN,
Constants.LAYER_TECHNICAL,
Constants.PACKAGE_TECHNICAL_AS400, "51");
}
if (FORMAT_DATE.equals(field.format))
{
field.length = Constants.AS400_CALL_DATE_FORMAT.length();
}
else
{
length = attributes.getNamedItem(ATTRIBUTE_LENGTH);
if (length != null)
{
try
{
field.length = Integer.parseInt(length