fixed categoryQName

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/gcubedatacatalogue-metadata-discovery@146469 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2017-03-31 08:48:12 +00:00
parent 6fc07e7469
commit a6ae1f4bab
2 changed files with 9 additions and 11 deletions

View File

@ -26,7 +26,7 @@ import org.gcube.datacatalogue.metadatadiscovery.MetadataNamespace;
public class MetadataCategory implements Serializable{
/**
*
*
*/
private static final String NAME_ELEMENT_METADATACATEGORY = "metadatacategory";
@ -44,7 +44,7 @@ public class MetadataCategory implements Serializable{
private String description = null;
@XmlTransient
private String namespaceCategory = null;
private String namespaceCategory = NAME_ELEMENT_METADATACATEGORY;
/**
* Instantiates a new metadata category.
@ -76,7 +76,7 @@ public class MetadataCategory implements Serializable{
public MetadataCategory(String id, String title, String description) {
super();
setId(id);
this.id = id;
this.title = title;
this.description = description;
}
@ -122,18 +122,15 @@ public class MetadataCategory implements Serializable{
public void setId(String id) {
this.id = id;
setNamespaceCategory();
}
/**
* Sets the namespace category.
* Gets the category qualifier name. The QName is a unique name to identify the category.
* It is the identifier: {@link MetadataCategory#namespaceCategory} + {@link MetadataNamespace#Separator} + {@link MetadataCategory#id}
*
* @return the category q name
*/
private void setNamespaceCategory() {
this.namespaceCategory = NAME_ELEMENT_METADATACATEGORY;
}
public String getCategoryQName(){
return namespaceCategory+MetadataNamespace.Separator+id;

View File

@ -141,6 +141,7 @@ public class TestJaxbMetadataMarshUnmarsh {
if(mtds.getMetadataCategories()!=null){
for (MetadataCategory cat : mtds.getMetadataCategories()) {
System.out.println(cat);
System.out.println(cat.getCategoryQName());
}
}