Copyright (c) 2013 Lorenz Lehmann
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Sof...
If you think the Android project sodf listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package lal.sodf.framework.ontology;
//fromwww.java2s.com/**
* The node which is the root of the metadata section
* @author Lorenz Lehmann
*
*/publicclass MetadataNode extends KeyNode {
/** A reference to the prefixes key */private KeyNode prefixes;
/**
* Create a new metadata node, which serves as root of the metadata section.
* This node always has a prefixes child that is the sodf prefix
*/public MetadataNode(KeyNode _parent) {
super(_parent, SodfVocabulary.SODF_METADATA);
//create a prefix node
prefixes = new KeyNode(this, SodfVocabulary.SODF_PREFIXES);
//add the SODF data
prefixes.addChild(new KeyValueNode(SodfVocabulary.SODF_PREFIX_KEY,SodfVocabulary.SODF_PREFIX_VALUE));
//add the SODF prefix
this.addChild(prefixes);
}
/**
* Create a new metadata node, which serves as root of the metadata section.
* This node always has a prefixes child that is the sodf prefix
*/public MetadataNode() {
super(SodfVocabulary.SODF_METADATA);
//create a prefix node
prefixes = new KeyNode(this, SodfVocabulary.SODF_PREFIXES);
//add the SODF data
prefixes.addChild(new KeyValueNode(SodfVocabulary.SODF_PREFIX_KEY,SodfVocabulary.SODF_PREFIX_VALUE));
//add the SODF prefix
this.addChild(prefixes);
}
/**
* Create a new metadata node, which serves as root of the metadata section.
* This node always has a prefixes child that is the sodf prefix
*/public MetadataNode(KeyNode _parent, KeyNode _prefixes) {
super(_parent, SodfVocabulary.SODF_METADATA);
prefixes = _prefixes;
}
/** Get the subtree, which contains all the prefixes */public KeyNode getPrefixesSubtree(){
return prefixes;
}
/** Set the prefixes subtree to a specific node */publicvoid setPrefixesSubtree(KeyNode _prefixes){
prefixes = _prefixes;
}
}