* @param parent the attribute node
* @return the metadata, or null if none found
* @throws Exception if generation fails
*/
protected ProtectedProperties createMetadata(Element parent) throws Exception {
ProtectedProperties result;
Properties props;
Vector list;
Element node;
Element metanode;
int i;
result = null;
// find metadata node directly underneath this attribute, but not in
// deeper nested attributes (e.g., within relational attributes)
metanode = null;
list = getChildTags(parent, TAG_METADATA);
if (list.size() > 0)
metanode = (Element) list.get(0);
// generate properties
if (metanode != null) {
props = new Properties();
list = getChildTags(metanode, TAG_PROPERTY);
for (i = 0; i < list.size(); i++) {
node = (Element) list.get(i);
props.setProperty(node.getAttribute(ATT_NAME), getContent(node));
}
result = new ProtectedProperties(props);
}
return result;
}