Package org.spdx.rdfparser.license
Class LicenseException
java.lang.Object
org.spdx.rdfparser.license.LicenseException
- Direct Known Subclasses:
ListedLicenseException
public class LicenseException extends Object implements IRdfModel, Cloneable
Represents an SPDX license exception as defined in the License Expression Language
Used with the "with" unary expression.
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors Constructor Description LicenseException()LicenseException(String exceptionId)LicenseException(String licenseExceptionId, String name, String licenseExceptionText)LicenseException(String licenseExceptionId, String name, String licenseExceptionText, String[] seeAlso, String comment)LicenseException(String licenseExceptionId, String name, String licenseExceptionText, String[] seeAlso, String comment, String example)Deprecated.LicenseException(String licenseExceptionId, String name, String licenseExceptionText, String licenseExceptionTemplate, String[] seeAlso, String comment)LicenseException(IModelContainer modelContainer, org.apache.jena.graph.Node node) -
Method Summary
Modifier and Type Method Description LicenseExceptionclone()voidcopyFrom(LicenseException exception)Copy all of the parameters from another licenseorg.apache.jena.rdf.model.ResourcecreateResource(IModelContainer modelContainer)If a resource does not already exist in this model for this object, create a new resource and populate it.booleanequals(Object o)booleanequivalent(IRdfModel compare)Returns true if the compare object contains properties which would be equal if they were contained in the same RDF Modelstatic org.apache.jena.graph.NodefindException(org.apache.jena.rdf.model.Model model, String id)Searches the model for a exception with the IDStringgetComment()StringgetExample()Deprecated.static StringgetExceptionTextFromModel(org.apache.jena.rdf.model.Model model, org.apache.jena.graph.Node exceptionNode)Get the exception text from the modelStringgetLicenseExceptionId()StringgetLicenseExceptionTemplate()StringgetLicenseExceptionText()StringgetName()String[]getSeeAlso()protected StringgetUri(IModelContainer modelContainer)inthashCode()booleanisDeprecated()voidsetComment(String comment)voidsetDeprecated(boolean deprecated)voidsetExample(String example)Deprecated.voidsetLicenseExceptionId(String id)voidsetLicenseExceptionTemplate(String template)voidsetLicenseExceptionText(String text)voidsetMultipleObjectsForSameNode()Called to signal that there are multiple objects representing the same nodevoidsetName(String name)voidsetSeeAlso(String[] url)voidsetSingleObjectForSameNode()Called to signal that a newly created resource is only used for a single nodeStringtoString()List<String>verify()
-
Constructor Details
-
LicenseException
public LicenseException(IModelContainer modelContainer, org.apache.jena.graph.Node node) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-
LicenseException
@Deprecated public LicenseException(String licenseExceptionId, String name, String licenseExceptionText, String[] seeAlso, String comment, String example)Deprecated.The example field is no longer used, please use the constructor without th example- Parameters:
licenseExceptionId- Exception ID - short form IDname- Full name of the ExceptionlicenseExceptionText- Text for the Exceptioncomment- Comments on the exceptionexample- Example of useseeAlso- URL references to external sources for the exception
-
LicenseException
public LicenseException(String licenseExceptionId, String name, String licenseExceptionText, String[] seeAlso, String comment)- Parameters:
licenseExceptionId- Exception ID - short form IDname- Full name of the ExceptionlicenseExceptionText- Text for the Exceptioncomment- Comments on the exceptionexample- Example of useseeAlso- URL references to external sources for the exception
-
LicenseException
public LicenseException(String licenseExceptionId, String name, String licenseExceptionText, String licenseExceptionTemplate, String[] seeAlso, String comment)- Parameters:
licenseExceptionId- Exception ID - short form IDname- Full name of the ExceptionlicenseExceptionText- Text for the ExceptionlicenseExceptionTemplate- License exception template use for matching license exceptions per SPDX license matching guidelinescomment- Comments on the exceptionseeAlso- URL references to external sources for the exception
-
LicenseException
- Parameters:
licenseExceptionId- Exception ID - short form IDname- Full name of the ExceptionlicenseExceptionText- Text for the Exception
-
LicenseException
public LicenseException() -
LicenseException
- Parameters:
token-
-
-
Method Details
-
createResource
public org.apache.jena.rdf.model.Resource createResource(IModelContainer modelContainer) throws InvalidSPDXAnalysisExceptionIf a resource does not already exist in this model for this object, create a new resource and populate it. If the resource does exist, return the existing resource.- Specified by:
createResourcein interfaceIRdfModel- Parameters:
model-- Returns:
- resource created from the model
- Throws:
InvalidSPDXAnalysisException
-
getExceptionTextFromModel
public static String getExceptionTextFromModel(org.apache.jena.rdf.model.Model model, org.apache.jena.graph.Node exceptionNode)Get the exception text from the model- Parameters:
model-exceptionNode-- Returns:
-
findException
public static org.apache.jena.graph.Node findException(org.apache.jena.rdf.model.Model model, String id)Searches the model for a exception with the ID- Parameters:
model-id-- Returns:
- Node containing the exception or Null if none found
-
getLicenseExceptionId
- Returns:
- the id
-
setLicenseExceptionId
- Parameters:
id- the id to set- Throws:
InvalidSPDXAnalysisException
-
getName
- Returns:
- the name
-
setName
- Parameters:
name- the name to set
-
getLicenseExceptionText
- Returns:
- the text
-
setLicenseExceptionText
- Parameters:
text- the text to set
-
getLicenseExceptionTemplate
- Returns:
- the tempalte
-
setLicenseExceptionTemplate
- Parameters:
template- the text to set
-
getSeeAlso
- Returns:
- the sourceUrl
-
setSeeAlso
- Parameters:
url- the sourceUrl to set
-
getComment
- Returns:
-
setComment
-
getExample
Deprecated.- Returns:
-
setExample
Deprecated. -
clone
-
toString
-
equals
-
hashCode
public int hashCode() -
verify
-
equivalent
Description copied from interface:IRdfModelReturns true if the compare object contains properties which would be equal if they were contained in the same RDF Model- Specified by:
equivalentin interfaceIRdfModel- Returns:
-
setMultipleObjectsForSameNode
public void setMultipleObjectsForSameNode()Description copied from interface:IRdfModelCalled to signal that there are multiple objects representing the same node- Specified by:
setMultipleObjectsForSameNodein interfaceIRdfModel
-
setSingleObjectForSameNode
public void setSingleObjectForSameNode()Description copied from interface:IRdfModelCalled to signal that a newly created resource is only used for a single node- Specified by:
setSingleObjectForSameNodein interfaceIRdfModel
-
isDeprecated
public boolean isDeprecated()- Returns:
- true if this license is marked as being deprecated
-
setDeprecated
public void setDeprecated(boolean deprecated)- Parameters:
deprecated- true if this license is deprecated
-
copyFrom
Copy all of the parameters from another license- Parameters:
exception-- Throws:
InvalidSPDXAnalysisException
-
getUri
- Throws:
InvalidSPDXAnalysisException
-