Package org.spdx.storage.listedlicense
Class LicenseJson
java.lang.Object
org.spdx.storage.listedlicense.LicenseJson
public class LicenseJson extends Object
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 Constructor Description LicenseJson()LicenseJson(String id) -
Method Summary
Modifier and Type Method Description booleanaddCrossRefValueToList(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<String>getPropertyValueNames()ObjectgetValue(String propertyName)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 InvalidSPDXAnalysisExceptionAdd 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 InvalidSPDXAnalysisExceptionAdd 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
-