public class SpdxElement extends RdfModelObject
| Modifier and Type | Field and Description |
|---|---|
protected Annotation[] |
annotations |
protected String |
comment |
protected String |
name |
protected Relationship[] |
relationships |
model, modelContainer, node, refreshOnGet, resource| Constructor and Description |
|---|
SpdxElement(IModelContainer modelContainer,
org.apache.jena.graph.Node node) |
SpdxElement(String name,
String comment,
Annotation[] annotations,
Relationship[] relationships) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAnnotation(Annotation annotation) |
protected void |
addNameToWarnings(List<String> warnings)
Add the name of the element to all strings in the list
|
void |
addRelationship(Relationship relationship) |
boolean |
arraysEquivalent(IRdfModel[] array1,
IRdfModel[] array2)
Compares 2 arrays to see if the property values for the element RdfModelObjects are the same independent of
order and considering nulls
|
boolean |
arraysEquivalent(IRdfModel[] array1,
IRdfModel[] array2,
boolean testRelationships)
Compares 2 arrays to see if the property values for the element RdfModelObjects are the same independent of
order and considering nulls
|
SpdxElement |
clone() |
SpdxElement |
clone(Map<String,SpdxElement> clonedElementIds)
Clones this element, but prevents infinite recursion by
keeping track of all elements which have been cloned
|
protected Annotation[] |
cloneAnnotations() |
protected Relationship[] |
cloneRelationships(Map<String,SpdxElement> clonedElementIds) |
boolean |
equivalent(IRdfModel o)
Returns true if the compare object contains properties which would be equal if they were contained in the same RDF Model
|
boolean |
equivalent(IRdfModel o,
boolean testRelationships)
Test for equivalent
|
boolean |
equivalentConsideringNull(IRdfModel o1,
IRdfModel o2)
Compares the properties of two RdfModelObjects considering possible null values
|
boolean |
equivalentConsideringNull(SpdxElement o1,
SpdxElement o2,
boolean testRelationship)
Compares the properties of two RdfModelObjects considering possible null values
|
Annotation[] |
getAnnotations() |
String |
getComment() |
String |
getId()
The ID is a unique identify for the SPDX element.
|
String |
getName() |
protected String |
getNamePropertyName() |
void |
getPropertiesFromModel()
Fetch all of the properties from the model and populate the local Java properties
|
Relationship[] |
getRelationships() |
org.apache.jena.rdf.model.Resource |
getType(org.apache.jena.rdf.model.Model model) |
String |
getUri(IModelContainer modelContainer)
Get the URI for this RDF object.
|
void |
populateModel()
Populate the RDF model from the Java properties
|
void |
setAnnotations(Annotation[] annotations) |
void |
setComment(String comment) |
void |
setId(String id)
The ID is a unique identify for the SPDX element.
|
void |
setName(String name)
Set the name
|
void |
setRelationships(Relationship[] relationships) |
String |
toString() |
List<String> |
verify() |
addPropertyUriValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, createResource, createResource, equals, findAnnotationPropertyValues, findAnyLicenseInfoPropertyValue, findAnyLicenseInfoPropertyValues, findChecksumPropertyValue, findCreationInfoPropertyValue, findDuplicateResource, findElementPropertyValue, findExternalDocRefPropertyValues, findExternalDocRefPropertyValues, findExternalRefPropertyValues, findIntPropertyValue, findMultipleChecksumPropertyValues, findMultipleDoapPropertyValues, findMultipleElementPropertyValues, findMultiplePropertyValues, findReferenceTypePropertyValue, findRelationshipPropertyValues, findReviewPropertyValues, findSinglePointerPropertyValue, findSinglePropertyValue, findStartEndPointerPropertyValues, findUriPropertyValue, findUriPropertyValues, findVerificationCodePropertyValue, getNode, hashCode, isRefreshOnGet, removePropertyValue, resourcesEqual, setMultipleObjectsForSameNode, setPropertyUriValue, setPropertyUriValues, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setSingleObjectForSameNodeprotected Annotation[] annotations
protected String comment
protected String name
protected Relationship[] relationships
public SpdxElement(IModelContainer modelContainer, org.apache.jena.graph.Node node) throws InvalidSPDXAnalysisException
InvalidSPDXAnalysisExceptionpublic SpdxElement(String name, String comment, Annotation[] annotations, Relationship[] relationships)
name - Name of the elementcomment - Optional comment on the elementannotations - Optional annotations for the elementrelationships - Optional relationships with other elementspublic void getPropertiesFromModel()
throws InvalidSPDXAnalysisException
RdfModelObjectgetPropertiesFromModel in class RdfModelObjectInvalidSPDXAnalysisExceptionpublic void populateModel()
throws InvalidSPDXAnalysisException
RdfModelObjectpopulateModel in class RdfModelObjectInvalidSPDXAnalysisExceptionpublic List<String> verify()
protected void addNameToWarnings(List<String> warnings)
warnings - public Annotation[] getAnnotations()
public void setAnnotations(Annotation[] annotations) throws InvalidSPDXAnalysisException
annotations - the annotations to setInvalidSPDXAnalysisExceptionpublic String getComment()
public void setComment(String comment)
comment - the comment to setpublic String getName()
protected String getNamePropertyName()
public void setName(String name)
name - the name to setpublic Relationship[] getRelationships()
public void setRelationships(Relationship[] relationships) throws InvalidSPDXAnalysisException
relationships - the relationships to setInvalidSPDXAnalysisExceptionpublic String getId()
public void setId(String id) throws InvalidSPDXAnalysisException
id - InvalidSPDXAnalysisExceptionpublic String getUri(IModelContainer modelContainer) throws InvalidSPDXAnalysisException
RdfModelObjectgetUri in class RdfModelObjectInvalidSPDXAnalysisExceptionpublic org.apache.jena.rdf.model.Resource getType(org.apache.jena.rdf.model.Model model)
getType in class RdfModelObjectprotected Annotation[] cloneAnnotations()
protected Relationship[] cloneRelationships(Map<String,SpdxElement> clonedElementIds)
public SpdxElement clone()
public SpdxElement clone(Map<String,SpdxElement> clonedElementIds)
clonedElementIds - element ID's fo all elements which have been clonedpublic boolean equivalent(IRdfModel o)
IRdfModelpublic boolean equivalent(IRdfModel o, boolean testRelationships)
o - testRelationships - If true, test relationshipspublic void addRelationship(Relationship relationship) throws InvalidSPDXAnalysisException
describesRelationship - InvalidSPDXAnalysisExceptionpublic void addAnnotation(Annotation annotation) throws InvalidSPDXAnalysisException
annotation - InvalidSPDXAnalysisExceptionpublic boolean arraysEquivalent(IRdfModel[] array1, IRdfModel[] array2)
arraysEquivalent in class RdfModelObjectarray1 - array2 - testRelationships - If true, test relationships for an SpdxElement (used to manage infinite recursion on circular relationships)public boolean arraysEquivalent(IRdfModel[] array1, IRdfModel[] array2, boolean testRelationships)
array1 - array2 - testRelationships - If true, test relationships for an SpdxElement (used to manage infinite recursion on circular relationships)public boolean equivalentConsideringNull(IRdfModel o1, IRdfModel o2)
equivalentConsideringNull in class RdfModelObjecto1 - o2 - public boolean equivalentConsideringNull(SpdxElement o1, SpdxElement o2, boolean testRelationship)
o1 - o2 - testRelationships - If true, test relationships for an SpdxElement (used to manage infinite recursion on circular relationships)Copyright © 2017 Linux Foundation. All Rights Reserved.