Example usage for com.google.gson JsonObject JsonObject

List of usage examples for com.google.gson JsonObject JsonObject

Introduction

In this page you can find the example usage for com.google.gson JsonObject JsonObject.

Prototype

JsonObject

Source Link

Usage

From source file:buri.ddmsence.ddms.Resource.java

License:Open Source License

/**
 * @see AbstractBaseComponent#getJSONObject()
 *///  w  w  w .j a  va2s .  c  om
public JsonObject getJSONObject() {
    JsonObject object = new JsonObject();
    addJson(object, RESOURCE_ELEMENT_NAME, isResourceElement());
    if (getCreateDate() != null)
        addJson(object, CREATE_DATE_NAME, getCreateDate().toXMLFormat());
    addJson(object, COMPLIES_WITH_NAME, getCompliesWiths());
    addJson(object, "ism." + DES_VERSION_NAME, getIsmDESVersion());
    addJson(object, "ntk." + DES_VERSION_NAME, getNtkDESVersion());
    addJson(object, getSecurityAttributes());
    addJson(object, getNoticeAttributes());
    addJson(object, getExtensibleAttributes());
    addJson(object, getMetacardInfo());
    addJson(object, "identifier", getIdentifiers());
    addJson(object, "title", getTitles());
    addJson(object, "subtitle", getSubtitles());
    addJson(object, getDescription());
    addJson(object, "language", getLanguages());
    addJson(object, getDates());
    addJson(object, getRights());
    addJson(object, "source", getSources());
    addJson(object, "type", getTypes());
    addJson(object, "creator", getCreators());
    addJson(object, "publisher", getPublishers());
    addJson(object, "contributor", getContributors());
    addJson(object, "pointOfContact", getPointOfContacts());
    addJson(object, getFormat());
    addJson(object, "subjectCoverage", getSubjectCoverages());
    addJson(object, "virtualCoverage", getVirtualCoverages());
    addJson(object, "temporalCoverage", getTemporalCoverages());
    addJson(object, "geospatialCoverage", getGeospatialCoverages());
    addJson(object, "relatedResource", getRelatedResources());
    addJson(object, getResourceManagement());
    addJson(object, getSecurity());
    addJson(object, "extensible.layer", !getExtensibleElements().isEmpty());
    addJson(object, "ddms.generator", "DDMSence " + PropertyReader.getProperty("version"));
    addJson(object, "ddms.version", getDDMSVersion().getVersion());
    return (object);
}

From source file:buri.ddmsence.ddms.security.ism.Notice.java

License:Open Source License

/**
 * @see AbstractBaseComponent#getJSONObject()
 *//*from   w  w  w .j a  va 2s  .c  om*/
public JsonObject getJSONObject() {
    JsonObject object = new JsonObject();
    addJson(object, "noticeText", getNoticeTexts());
    addJson(object, getSecurityAttributes());
    addJson(object, getNoticeAttributes());
    return (object);
}

From source file:buri.ddmsence.ddms.security.ism.NoticeAttributes.java

License:Open Source License

/**
 * @see AbstractAttributeGroup#getJSONObject()
 *///from  ww  w .ja  va2 s .  c o  m
public JsonObject getJSONObject() {
    JsonObject object = new JsonObject();
    addJson(object, NOTICE_TYPE_NAME, getNoticeType());
    addJson(object, NOTICE_REASON_NAME, getNoticeReason());
    if (getNoticeDate() != null) {
        addJson(object, NOTICE_DATE_NAME, getNoticeDate().toXMLFormat());
    }
    addJson(object, UNREGISTERED_NOTICE_TYPE_NAME, getUnregisteredNoticeType());
    addJson(object, EXTERNAL_NOTICE_NAME, isExternalReference());
    return (object);
}

From source file:buri.ddmsence.ddms.security.ism.NoticeText.java

License:Open Source License

/**
 * @see AbstractBaseComponent#getJSONObject()
 */// w  w w . ja v a 2s.c  o  m
public JsonObject getJSONObject() {
    JsonObject object = new JsonObject();
    addJson(object, "noticeText", getValue());
    addJson(object, POC_TYPE_NAME, getPocTypes());
    addJson(object, getSecurityAttributes());
    return (object);
}

From source file:buri.ddmsence.ddms.security.ism.SecurityAttributes.java

License:Open Source License

/**
 * @see AbstractAttributeGroup#getJSONObject()
 *//*from  w  w  w  .jav a2s.c  o m*/
public JsonObject getJSONObject() {
    JsonObject object = new JsonObject();
    addJson(object, ATOMIC_ENERGY_MARKINGS_NAME, getAtomicEnergyMarkings());
    addJson(object, CLASSIFICATION_NAME, getClassification());
    addJson(object, CLASSIFICATION_REASON_NAME, getClassificationReason());
    addJson(object, CLASSIFIED_BY_NAME, getClassifiedBy());
    addJson(object, COMPILATION_REASON_NAME, getCompilationReason());
    if (getDateOfExemptedSource() != null) {
        addJson(object, DATE_OF_EXEMPTED_SOURCE_NAME, getDateOfExemptedSource().toXMLFormat());
    }
    if (getDeclassDate() != null)
        addJson(object, DECLASS_DATE_NAME, getDeclassDate().toXMLFormat());
    addJson(object, DECLASS_EVENT_NAME, getDeclassEvent());
    addJson(object, DECLASS_EXCEPTION_NAME, getDeclassException());
    addJson(object, DECLASS_MANUAL_REVIEW_NAME, getDeclassManualReview());
    addJson(object, DERIVATIVELY_CLASSIFIED_BY_NAME, getDerivativelyClassifiedBy());
    addJson(object, DERIVED_FROM_NAME, getDerivedFrom());
    addJson(object, DISPLAY_ONLY_TO_NAME, getDisplayOnlyTo());
    addJson(object, DISSEMINATION_CONTROLS_NAME, getDisseminationControls());
    addJson(object, FGI_SOURCE_OPEN_NAME, getFGIsourceOpen());
    addJson(object, FGI_SOURCE_PROTECTED_NAME, getFGIsourceProtected());
    addJson(object, NON_IC_MARKINGS_NAME, getNonICmarkings());
    addJson(object, NON_US_CONTROLS_NAME, getNonUSControls());
    addJson(object, OWNER_PRODUCER_NAME, getOwnerProducers());
    addJson(object, RELEASABLE_TO_NAME, getReleasableTo());
    addJson(object, SAR_IDENTIFIER_NAME, getSARIdentifier());
    addJson(object, SCI_CONTROLS_NAME, getSCIcontrols());
    addJson(object, TYPE_OF_EXEMPTED_SOURCE_NAME, getTypeOfExemptedSource());
    return (object);
}

From source file:buri.ddmsence.ddms.security.NoticeList.java

License:Open Source License

/**
 * @see AbstractBaseComponent#getJSONObject()
 *//*from  w  w w  . j  a v  a  2 s . c o m*/
public JsonObject getJSONObject() {
    JsonObject object = new JsonObject();
    addJson(object, "notice", getNotices());
    addJson(object, getSecurityAttributes());
    return (object);
}

From source file:buri.ddmsence.ddms.security.ntk.Access.java

License:Open Source License

/**
 * An extra layer is added around the individualList and groupList, to make the output consistent with the profileList.
 * /*www  .  j  a va  2  s  .c o  m*/
 * @see AbstractBaseComponent#getJSONObject()
 */
public JsonObject getJSONObject() {
    JsonObject object = new JsonObject();

    if (!getIndividuals().isEmpty()) {
        JsonObject individualList = new JsonObject();
        individualList.add("individual", Util.getJSONArray(getIndividuals()));
        addJson(object, "individualList", individualList);
    }

    if (!getGroups().isEmpty()) {
        JsonObject groupList = new JsonObject();
        groupList.add("group", Util.getJSONArray(getGroups()));
        addJson(object, "groupList", groupList);
    }

    if (getProfileList() != null)
        addJson(object, "profileList", getProfileList().getJSONObject());
    addJson(object, EXTERNAL_REFERENCE_NAME, isExternalReference());
    addJson(object, getSecurityAttributes());
    return (object);
}

From source file:buri.ddmsence.ddms.security.ntk.GroupValue.java

License:Open Source License

/**
 * @see AbstractBaseComponent#getJSONObject()
 *//*from  w  ww . ja  v a  2 s  . c  o m*/
public JsonObject getJSONObject() {
    JsonObject object = new JsonObject();
    addJson(object, "groupValue", getValue());
    addJson(object, "id", getID());
    addJson(object, "idReference", getIDReference());
    addJson(object, "qualifier", getQualifier());
    addJson(object, getSecurityAttributes());
    return (object);
}

From source file:buri.ddmsence.ddms.security.ntk.IndividualValue.java

License:Open Source License

/**
 * @see AbstractBaseComponent#getJSONObject()
 *///from  w  ww.  j a  va 2 s.  c  o m
public JsonObject getJSONObject() {
    JsonObject object = new JsonObject();
    addJson(object, "individualValue", getValue());
    addJson(object, "id", getID());
    addJson(object, "idReference", getIDReference());
    addJson(object, "qualifier", getQualifier());
    addJson(object, getSecurityAttributes());
    return (object);
}

From source file:buri.ddmsence.ddms.security.ntk.ProfileList.java

License:Open Source License

/**
 * @see AbstractBaseComponent#getJSONObject()
 *//*  w w  w  . j  a v a  2 s  .c o  m*/
public JsonObject getJSONObject() {
    JsonObject object = new JsonObject();
    addJson(object, "profile", getProfiles());
    addJson(object, getSecurityAttributes());
    return (object);
}