Package org.spdx.storage.listedlicense
Class LicenseJson
java.lang.Object
org.spdx.storage.listedlicense.LicenseJson
Simple POJO to hold the license data loaded from a JSON file
Licenses in the JSON format can be found at spdx.org/licenses/[licenseid].json
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddCrossRefValueToList(String propertyName, org.spdx.storage.listedlicense.CrossRefJson value) Add a cross reference to a value listbooleanaddPrimitiveValueToList(String propertyName, Object value) Add a primitive value to a value listvoidclearPropertyValueList(String propertyName) voidcopyFrom(SpdxListedLicense fromLicense) List<?>getValueList(String propertyName) booleanisCollectionMembersAssignableTo(String propertyName, Class<?> clazz) booleanisCollectionProperty(String propertyName) booleanisPropertyValueAssignableTo(String propertyName, Class<?> clazz) booleanremovePrimitiveValueToList(String propertyName, Object value) voidremoveProperty(String propertyName) voidsetPrimativeValue(String propertyName, Object value) voidsetTypedProperty(String propertyName, String valueId, String type)
-
Constructor Details
-
LicenseJson
-
LicenseJson
public LicenseJson()
-
-
Method Details
-
getPropertyValueNames
-
setTypedProperty
public void setTypedProperty(String propertyName, String valueId, String type) throws InvalidSpdxPropertyException - Throws:
InvalidSpdxPropertyException
-
setPrimativeValue
public void setPrimativeValue(String propertyName, Object value) throws InvalidSpdxPropertyException - Throws:
InvalidSpdxPropertyException
-
clearPropertyValueList
- Throws:
InvalidSpdxPropertyException
-
addCrossRefValueToList
public boolean addCrossRefValueToList(String propertyName, org.spdx.storage.listedlicense.CrossRefJson value) throws InvalidSPDXAnalysisException Add a cross reference to a value list- Parameters:
propertyName-value-- Returns:
- true as specified by
Collections.add - Throws:
InvalidSPDXAnalysisException
-
addPrimitiveValueToList
public boolean addPrimitiveValueToList(String propertyName, Object value) throws InvalidSPDXAnalysisException Add a primitive value to a value list- Parameters:
propertyName-value-- Returns:
- true as specified by
Collections.add - Throws:
InvalidSPDXAnalysisException
-
removePrimitiveValueToList
public boolean removePrimitiveValueToList(String propertyName, Object value) throws InvalidSpdxPropertyException - Throws:
InvalidSpdxPropertyException
-
getValueList
- Throws:
InvalidSpdxPropertyException
-
getValue
- Throws:
InvalidSpdxPropertyException
-
removeProperty
- Throws:
InvalidSpdxPropertyException
-
copyFrom
public void copyFrom(SpdxListedLicense fromLicense) throws InvalidLicenseTemplateException, InvalidSPDXAnalysisException -
isPropertyValueAssignableTo
public boolean isPropertyValueAssignableTo(String propertyName, Class<?> clazz) throws InvalidSpdxPropertyException - Throws:
InvalidSpdxPropertyException
-
isCollectionMembersAssignableTo
-
isCollectionProperty
-