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

@ -44,7 +44,7 @@ public class MetadataCategory implements Serializable{
private String description = null; private String description = null;
@XmlTransient @XmlTransient
private String namespaceCategory = null; private String namespaceCategory = NAME_ELEMENT_METADATACATEGORY;
/** /**
* Instantiates a new metadata category. * Instantiates a new metadata category.
@ -76,7 +76,7 @@ public class MetadataCategory implements Serializable{
public MetadataCategory(String id, String title, String description) { public MetadataCategory(String id, String title, String description) {
super(); super();
setId(id); this.id = id;
this.title = title; this.title = title;
this.description = description; this.description = description;
} }
@ -122,18 +122,15 @@ public class MetadataCategory implements Serializable{
public void setId(String id) { public void setId(String id) {
this.id = 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(){ public String getCategoryQName(){
return namespaceCategory+MetadataNamespace.Separator+id; return namespaceCategory+MetadataNamespace.Separator+id;

View File

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