All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openprovenance.prov.xml.Bundle Maven / Gradle / Ivy

Go to download

Java Objects representing the PROV model and an XML serialiser/deserialiser for them. Classes were initially generated by JAXB, from the XML schema for PROV, and over time edited by hand.

There is a newer version: 1.0.0
Show newest version
package org.openprovenance.prov.xml;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlType;

import org.openprovenance.prov.xml.builder.Equals;
import org.openprovenance.prov.xml.builder.HashCode;
import org.openprovenance.prov.xml.builder.ToString;
import org.openprovenance.prov.xml.builder.JAXBEqualsBuilder;
import org.openprovenance.prov.xml.builder.JAXBHashCodeBuilder;
import org.openprovenance.prov.xml.builder.JAXBToStringBuilder;
import org.openprovenance.apache.commons.lang.builder.EqualsBuilder;
import org.openprovenance.apache.commons.lang.builder.HashCodeBuilder;
import org.openprovenance.apache.commons.lang.builder.ToStringBuilder;
import org.openprovenance.prov.model.Namespace;
import org.openprovenance.prov.model.Statement;


/**
 * 

Java class for NamedBundle complex type. * *

The following schema fragment specifies the expected content contained within this class. * *

 * <complexType name="NamedBundle">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence maxOccurs="unbounded">
 *         <group ref="{http://www.w3.org/ns/prov#}documentElements"/>
 *       </sequence>
 *       <attribute ref="{http://www.w3.org/ns/prov#}id"/>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "NamedBundle", propOrder = { "statement" }) public class Bundle implements Equals, HashCode, ToString, org.openprovenance.prov.model.Bundle { @XmlElements({ @XmlElement(name = "entity", type = Entity.class), @XmlElement(name = "activity", type = Activity.class), @XmlElement(name = "wasGeneratedBy", type = WasGeneratedBy.class), @XmlElement(name = "used", type = Used.class), @XmlElement(name = "wasInformedBy", type = WasInformedBy.class), @XmlElement(name = "wasStartedBy", type = WasStartedBy.class), @XmlElement(name = "wasEndedBy", type = WasEndedBy.class), @XmlElement(name = "wasInvalidatedBy", type = WasInvalidatedBy.class), @XmlElement(name = "wasDerivedFrom", type = WasDerivedFrom.class), @XmlElement(name = "agent", type = Agent.class), @XmlElement(name = "wasAttributedTo", type = WasAttributedTo.class), @XmlElement(name = "wasAssociatedWith", type = WasAssociatedWith.class), @XmlElement(name = "actedOnBehalfOf", type = ActedOnBehalfOf.class), @XmlElement(name = "wasInfluencedBy", type = WasInfluencedBy.class), @XmlElement(name = "specializationOf", type = SpecializationOf.class), @XmlElement(name = "alternateOf", type = AlternateOf.class), @XmlElement(name = "hadMember", type = HadMember.class), @XmlElement(name = "mentionOf", type = MentionOf.class), @XmlElement(name = "plan", type = Plan.class), @XmlElement(name = "wasRevisionOf", type = Revision.class), @XmlElement(name = "wasQuotedFrom", type = Quotation.class), @XmlElement(name = "hadPrimarySource", type = PrimarySource.class), @XmlElement(name = "person", type = Person.class), @XmlElement(name = "organization", type = Organization.class), @XmlElement(name = "softwareAgent", type = SoftwareAgent.class), @XmlElement(name = "bundle", type = BundleEntity.class), @XmlElement(name = "collection", type = Collection.class), @XmlElement(name = "emptyCollection", type = EmptyCollection.class), @XmlElement(name = "dictionary", type = Dictionary.class), @XmlElement(name = "emptyDictionary", type = EmptyDictionary.class), @XmlElement(name = "hadDictionaryMember", type = DictionaryMembership.class), @XmlElement(name = "derivedByInsertionFrom", type = DerivedByInsertionFrom.class), @XmlElement(name = "derivedByRemovalFrom", type = DerivedByRemovalFrom.class) }) protected List statement; @XmlAttribute(name = "id", namespace = "http://www.w3.org/ns/prov#") @javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(QualifiedNameAdapter.class) protected org.openprovenance.prov.model.QualifiedName id; /** * Gets the value of the statement property. * *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a set method for the statement property. * *

* For example, to add a new item, do as follows: *

     *    getStatement().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link Entity } * {@link Activity } * {@link WasGeneratedBy } * {@link Used } * {@link WasInformedBy } * {@link WasStartedBy } * {@link WasEndedBy } * {@link WasInvalidatedBy } * {@link WasDerivedFrom } * {@link Agent } * {@link WasAttributedTo } * {@link WasAssociatedWith } * {@link ActedOnBehalfOf } * {@link WasInfluencedBy } * {@link SpecializationOf } * {@link AlternateOf } * {@link HadMember } * {@link MentionOf } * {@link Plan } * {@link Revision } * {@link Quotation } * {@link PrimarySource } * {@link Person } * {@link Organization } * {@link SoftwareAgent } * {@link BundleEntity } * {@link Collection } * {@link EmptyCollection } * {@link Dictionary } * {@link EmptyDictionary } * {@link DictionaryMembership } * {@link DerivedByInsertionFrom } * {@link DerivedByRemovalFrom } * * */ public List getStatement() { if (statement == null) { statement = new ArrayList(); } return this.statement; } /** * Gets the value of the id property. * * @return * possible object is * {@link org.openprovenance.prov.model.QualifiedName } * */ public org.openprovenance.prov.model.QualifiedName getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link org.openprovenance.prov.model.QualifiedName } * */ public void setId(org.openprovenance.prov.model.QualifiedName value) { this.id = value; } public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof Bundle)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } final Bundle that = ((Bundle) object); equalsBuilder.append(this.getStatement(), that.getStatement()); equalsBuilder.append(this.getId(), that.getId()); } public boolean equals(Object object) { if (!(object instanceof Bundle)) { return false; } if (this == object) { return true; } final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder(); equals(object, equalsBuilder); return equalsBuilder.isEquals(); } public void hashCode(HashCodeBuilder hashCodeBuilder) { hashCodeBuilder.append(this.getStatement()); hashCodeBuilder.append(this.getId()); } public int hashCode() { final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder(); hashCode(hashCodeBuilder); return hashCodeBuilder.toHashCode(); } public void toString(ToStringBuilder toStringBuilder) { { List theStatement; theStatement = this.getStatement(); toStringBuilder.append("statement", theStatement); } { org.openprovenance.prov.model.QualifiedName theId; theId = this.getId(); toStringBuilder.append("id", theId); } } @javax.xml.bind.annotation.XmlTransient private Namespace namespace=null; @Override public Namespace getNamespace() { return namespace; } @Override public void setNamespace(Namespace namespace) { this.namespace=namespace; } public String toString() { final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this); toString(toStringBuilder); return toStringBuilder.toString(); } public Kind getKind() { return org.openprovenance.prov.model.StatementOrBundle.Kind.PROV_BUNDLE; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy