Class CrossRefJson


  • public class CrossRefJson
    extends Object
    JSON Representation of a CrossRef
    Author:
    Gary O'Neall
    • Constructor Detail

      • CrossRefJson

        public CrossRefJson()
      • CrossRefJson

        public CrossRefJson​(org.spdx.library.model.v2.license.CrossRef crossRef)
                     throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        crossRef - cross ref to copy values from
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException - on SPDX parsing errors
    • Method Detail

      • getPropertyValueDescriptors

        public List<org.spdx.storage.PropertyDescriptor> getPropertyValueDescriptors()
        Returns:
        all valid property descriptors
      • setPrimativeValue

        public void setPrimativeValue​(org.spdx.storage.PropertyDescriptor propertyDescriptor,
                                      Object value)
                               throws org.spdx.core.InvalidSpdxPropertyException
        Sets the value to the property name
        Parameters:
        propertyDescriptor - descriptor for the property to set
        value - Value to set
        Throws:
        org.spdx.core.InvalidSpdxPropertyException - on SPDX parsing errors
      • clearPropertyValueList

        public void clearPropertyValueList​(org.spdx.storage.PropertyDescriptor propertyDescriptor)
                                    throws org.spdx.core.InvalidSpdxPropertyException
        Throws:
        org.spdx.core.InvalidSpdxPropertyException
      • addPrimitiveValueToList

        public boolean addPrimitiveValueToList​(org.spdx.storage.PropertyDescriptor propertyDescriptor,
                                               Object value)
                                        throws org.spdx.core.InvalidSpdxPropertyException
        Throws:
        org.spdx.core.InvalidSpdxPropertyException
      • removePrimitiveValueToList

        public boolean removePrimitiveValueToList​(org.spdx.storage.PropertyDescriptor propertyDescriptor,
                                                  Object value)
                                           throws org.spdx.core.InvalidSpdxPropertyException
        Throws:
        org.spdx.core.InvalidSpdxPropertyException
      • setId

        public void setId​(String crossRefId)
      • getValueList

        public List<?> getValueList​(org.spdx.storage.PropertyDescriptor propertyDescriptor)
                             throws org.spdx.core.InvalidSpdxPropertyException
        Parameters:
        propertyDescriptor - descriptor for the property to set
        Returns:
        the list associated with the property
        Throws:
        org.spdx.core.InvalidSpdxPropertyException - on SPDX parsing errors
      • getValue

        @Nullable
        public Object getValue​(org.spdx.storage.PropertyDescriptor propertyDescriptor)
                        throws org.spdx.core.InvalidSpdxPropertyException
        Parameters:
        propertyDescriptor - descriptor for the property to set
        Returns:
        the value associated with the property - null if not assigned or not present
        Throws:
        org.spdx.core.InvalidSpdxPropertyException - on SPDX parsing errors
      • removeProperty

        public void removeProperty​(org.spdx.storage.PropertyDescriptor propertyDescriptor)
                            throws org.spdx.core.InvalidSpdxPropertyException
        sets the property to null (no way to remove in this store)
        Parameters:
        propertyDescriptor - descriptor for the property to set
        Throws:
        org.spdx.core.InvalidSpdxPropertyException - on SPDX parsing errors
      • isCollectionMembersAssignableTo

        public boolean isCollectionMembersAssignableTo​(org.spdx.storage.PropertyDescriptor propertyDescriptor,
                                                       Class<?> clazz)
        Parameters:
        propertyDescriptor - descriptor for the property to set
        clazz - target class
        Returns:
        true if the members can be assigned from clazz
      • isPropertyValueAssignableTo

        public boolean isPropertyValueAssignableTo​(org.spdx.storage.PropertyDescriptor propertyDescriptor,
                                                   Class<?> clazz)
                                            throws org.spdx.core.InvalidSpdxPropertyException
        Parameters:
        propertyDescriptor - descriptor for the property to set
        clazz - target class
        Returns:
        true if the property can be assigned from clazz
        Throws:
        org.spdx.core.InvalidSpdxPropertyException - on SPDX parsing errors
      • isCollectionProperty

        public boolean isCollectionProperty​(String propertyName)
        Parameters:
        propertyName - Name of the property
        Returns:
        if the property is a collection