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

org.mitre.capec.capec_2.CompoundElement Maven / Gradle / Ivy

There is a newer version: 1.2.0.2
Show newest version
/**
 * Copyright (c) 2015, The MITRE Corporation. All rights reserved.
 * See LICENSE for complete terms.
 */

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-2 
// See http://java.sun.com/xml/jaxb 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2015.07.01 at 03:30:29 PM EDT 
//

package org.mitre.capec.capec_2;

import java.io.StringReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
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.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import javax.xml.transform.stream.StreamSource;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
import org.mitre.stix.DocumentUtilities;
import org.mitre.stix.STIXSchema;
import org.mitre.stix.ValidationEventHandler;
import org.xml.sax.SAXException;

/**
 * 

Java class for anonymous complex type. * *

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

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="Description">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 <sequence>
 *                   <element name="Description_Summary" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *                   <element name="Extended_Description" type="{http://capec.mitre.org/capec-2}Structured_Text_Type" minOccurs="0"/>
 *                 </sequence>
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *         <element ref="{http://capec.mitre.org/capec-2}Relationships" minOccurs="0"/>
 *         <element ref="{http://capec.mitre.org/capec-2}Relationship_Notes" minOccurs="0"/>
 *         <element ref="{http://capec.mitre.org/capec-2}Maintenance_Notes" minOccurs="0"/>
 *         <element name="Background_Details" minOccurs="0">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 <sequence>
 *                   <element name="Background_Detail" type="{http://capec.mitre.org/capec-2}Structured_Text_Type" maxOccurs="unbounded"/>
 *                 </sequence>
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *         <element ref="{http://capec.mitre.org/capec-2}Other_Notes" minOccurs="0"/>
 *         <element ref="{http://capec.mitre.org/capec-2}Alternate_Terms" minOccurs="0"/>
 *         <element ref="{http://capec.mitre.org/capec-2}Research_Gaps" minOccurs="0"/>
 *         <element name="References" type="{http://capec.mitre.org/capec-2}Reference_List_Type" minOccurs="0"/>
 *         <element ref="{http://capec.mitre.org/capec-2}Content_History" minOccurs="0"/>
 *       </sequence>
 *       <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
 *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="Compound_Element_Abstraction" use="required">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *             <whiteSpace value="collapse"/>
 *             <enumeration value="Meta"/>
 *             <enumeration value="Standard"/>
 *             <enumeration value="Detailed"/>
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *       <attribute name="Compound_Element_Completeness" use="required">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *             <whiteSpace value="collapse"/>
 *             <enumeration value="Complete"/>
 *             <enumeration value="Stub"/>
 *             <enumeration value="Hook"/>
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *       <attribute name="Compound_Element_Structure" use="required">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *             <whiteSpace value="collapse"/>
 *             <enumeration value="Composite"/>
 *             <enumeration value="Chain"/>
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *       <attribute name="Status" use="required" type="{http://capec.mitre.org/capec-2}Status_Type" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "description", "relationships", "relationshipNotes", "maintenanceNotes", "backgroundDetails", "otherNotes", "alternateTerms", "researchGaps", "references", "contentHistory" }) @XmlRootElement(name = "Compound_Element") public class CompoundElement implements Equals, HashCode, ToString { @XmlElement(name = "Description", required = true) protected CompoundElement.Description description; @XmlElement(name = "Relationships") protected Relationships relationships; @XmlElement(name = "Relationship_Notes") protected RelationshipNotes relationshipNotes; @XmlElement(name = "Maintenance_Notes") protected MaintenanceNotes maintenanceNotes; @XmlElement(name = "Background_Details") protected CompoundElement.BackgroundDetails backgroundDetails; @XmlElement(name = "Other_Notes") protected OtherNotes otherNotes; @XmlElement(name = "Alternate_Terms") protected AlternateTerms alternateTerms; @XmlElement(name = "Research_Gaps") protected ResearchGaps researchGaps; @XmlElement(name = "References") protected ReferenceListType references; @XmlElement(name = "Content_History") protected ContentHistory contentHistory; @XmlAttribute(name = "ID", required = true) protected BigInteger id; @XmlAttribute(name = "Name", required = true) protected String name; @XmlAttribute(name = "Compound_Element_Abstraction", required = true) protected String compoundElementAbstraction; @XmlAttribute(name = "Compound_Element_Completeness", required = true) protected String compoundElementCompleteness; @XmlAttribute(name = "Compound_Element_Structure", required = true) protected String compoundElementStructure; @XmlAttribute(name = "Status", required = true) protected StatusType status; /** * Default no-arg constructor * */ public CompoundElement() { super(); } /** * Fully-initialising value constructor * */ public CompoundElement(final CompoundElement.Description description, final Relationships relationships, final RelationshipNotes relationshipNotes, final MaintenanceNotes maintenanceNotes, final CompoundElement.BackgroundDetails backgroundDetails, final OtherNotes otherNotes, final AlternateTerms alternateTerms, final ResearchGaps researchGaps, final ReferenceListType references, final ContentHistory contentHistory, final BigInteger id, final String name, final String compoundElementAbstraction, final String compoundElementCompleteness, final String compoundElementStructure, final StatusType status) { this.description = description; this.relationships = relationships; this.relationshipNotes = relationshipNotes; this.maintenanceNotes = maintenanceNotes; this.backgroundDetails = backgroundDetails; this.otherNotes = otherNotes; this.alternateTerms = alternateTerms; this.researchGaps = researchGaps; this.references = references; this.contentHistory = contentHistory; this.id = id; this.name = name; this.compoundElementAbstraction = compoundElementAbstraction; this.compoundElementCompleteness = compoundElementCompleteness; this.compoundElementStructure = compoundElementStructure; this.status = status; } /** * Gets the value of the description property. * * @return * possible object is * {@link CompoundElement.Description } * */ public CompoundElement.Description getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link CompoundElement.Description } * */ public void setDescription(CompoundElement.Description value) { this.description = value; } /** * The Relationships structure contains one or more * Relationship elements, each of which identifies an association between * this structure, whether it is an Attack Pattern, Category, or * Compound_Element and another structure. * * @return * possible object is * {@link Relationships } * */ public Relationships getRelationships() { return relationships; } /** * Sets the value of the relationships property. * * @param value * allowed object is * {@link Relationships } * */ public void setRelationships(Relationships value) { this.relationships = value; } /** * This structure houses one or more Relationship_Note * elements, which each contain details regarding the relationships between * CAPEC entries. * * @return * possible object is * {@link RelationshipNotes } * */ public RelationshipNotes getRelationshipNotes() { return relationshipNotes; } /** * Sets the value of the relationshipNotes property. * * @param value * allowed object is * {@link RelationshipNotes } * */ public void setRelationshipNotes(RelationshipNotes value) { this.relationshipNotes = value; } /** * This element contains one or more Maintenance_Note * elements which each contain significant maintenance tasks within this * entry that still need to be addressed, such as clarifying the concepts * involved or improving relationships. It should be filled out in any * entry that is still undergoing significant review by the CAPEC * team. * * @return * possible object is * {@link MaintenanceNotes } * */ public MaintenanceNotes getMaintenanceNotes() { return maintenanceNotes; } /** * Sets the value of the maintenanceNotes property. * * @param value * allowed object is * {@link MaintenanceNotes } * */ public void setMaintenanceNotes(MaintenanceNotes value) { this.maintenanceNotes = value; } /** * Gets the value of the backgroundDetails property. * * @return * possible object is * {@link CompoundElement.BackgroundDetails } * */ public CompoundElement.BackgroundDetails getBackgroundDetails() { return backgroundDetails; } /** * Sets the value of the backgroundDetails property. * * @param value * allowed object is * {@link CompoundElement.BackgroundDetails } * */ public void setBackgroundDetails(CompoundElement.BackgroundDetails value) { this.backgroundDetails = value; } /** * This element contains one or more Note elements, each of * which provide any additional notes or comments that cannot be captured * using other elements. New elements might be defined in the future to * contain this information. It should be filled out where needed. * * * @return * possible object is * {@link OtherNotes } * */ public OtherNotes getOtherNotes() { return otherNotes; } /** * Sets the value of the otherNotes property. * * @param value * allowed object is * {@link OtherNotes } * */ public void setOtherNotes(OtherNotes value) { this.otherNotes = value; } /** * This element contains one or more Alternate_Term elements, * each of which contains other names used to describe this attack * pattern. * * @return * possible object is * {@link AlternateTerms } * */ public AlternateTerms getAlternateTerms() { return alternateTerms; } /** * Sets the value of the alternateTerms property. * * @param value * allowed object is * {@link AlternateTerms } * */ public void setAlternateTerms(AlternateTerms value) { this.alternateTerms = value; } /** * This structure contains one or more Research gap elements, * each of which identifies potential opportunities for the vulnerability * research community to conduct further exploration of issues related to * this attack pattern. It is intended to highlight parts of CAPEC that * have not received sufficient attention from researchers. This should be * filled out where appropriate for attack patterns and * categories. * * @return * possible object is * {@link ResearchGaps } * */ public ResearchGaps getResearchGaps() { return researchGaps; } /** * Sets the value of the researchGaps property. * * @param value * allowed object is * {@link ResearchGaps } * */ public void setResearchGaps(ResearchGaps value) { this.researchGaps = value; } /** * Gets the value of the references property. * * @return * possible object is * {@link ReferenceListType } * */ public ReferenceListType getReferences() { return references; } /** * Sets the value of the references property. * * @param value * allowed object is * {@link ReferenceListType } * */ public void setReferences(ReferenceListType value) { this.references = value; } /** * This element is used to keep track of the author of the * attack pattern entry and anyone who has made modifications to the * content. This provides a means of contacting the authors and modifiers * for clarifying ambiguities, merging overlapping contributions, etc. This * should be filled out for all entries. * * @return * possible object is * {@link ContentHistory } * */ public ContentHistory getContentHistory() { return contentHistory; } /** * Sets the value of the contentHistory property. * * @param value * allowed object is * {@link ContentHistory } * */ public void setContentHistory(ContentHistory value) { this.contentHistory = value; } /** * Gets the value of the id property. * * @return * possible object is * {@link BigInteger } * */ public BigInteger getID() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link BigInteger } * */ public void setID(BigInteger value) { this.id = value; } /** * Gets the value of the name property. * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * Sets the value of the name property. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } /** * Gets the value of the compoundElementAbstraction property. * * @return * possible object is * {@link String } * */ public String getCompoundElementAbstraction() { return compoundElementAbstraction; } /** * Sets the value of the compoundElementAbstraction property. * * @param value * allowed object is * {@link String } * */ public void setCompoundElementAbstraction(String value) { this.compoundElementAbstraction = value; } /** * Gets the value of the compoundElementCompleteness property. * * @return * possible object is * {@link String } * */ public String getCompoundElementCompleteness() { return compoundElementCompleteness; } /** * Sets the value of the compoundElementCompleteness property. * * @param value * allowed object is * {@link String } * */ public void setCompoundElementCompleteness(String value) { this.compoundElementCompleteness = value; } /** * Gets the value of the compoundElementStructure property. * * @return * possible object is * {@link String } * */ public String getCompoundElementStructure() { return compoundElementStructure; } /** * Sets the value of the compoundElementStructure property. * * @param value * allowed object is * {@link String } * */ public void setCompoundElementStructure(String value) { this.compoundElementStructure = value; } /** * Gets the value of the status property. * * @return * possible object is * {@link StatusType } * */ public StatusType getStatus() { return status; } /** * Sets the value of the status property. * * @param value * allowed object is * {@link StatusType } * */ public void setStatus(StatusType value) { this.status = value; } public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof CompoundElement)) { return false; } if (this == object) { return true; } final CompoundElement that = ((CompoundElement) object); { CompoundElement.Description lhsDescription; lhsDescription = this.getDescription(); CompoundElement.Description rhsDescription; rhsDescription = that.getDescription(); if (!strategy.equals(LocatorUtils.property(thisLocator, "description", lhsDescription), LocatorUtils.property( thatLocator, "description", rhsDescription), lhsDescription, rhsDescription)) { return false; } } { Relationships lhsRelationships; lhsRelationships = this.getRelationships(); Relationships rhsRelationships; rhsRelationships = that.getRelationships(); if (!strategy.equals(LocatorUtils.property(thisLocator, "relationships", lhsRelationships), LocatorUtils.property( thatLocator, "relationships", rhsRelationships), lhsRelationships, rhsRelationships)) { return false; } } { RelationshipNotes lhsRelationshipNotes; lhsRelationshipNotes = this.getRelationshipNotes(); RelationshipNotes rhsRelationshipNotes; rhsRelationshipNotes = that.getRelationshipNotes(); if (!strategy.equals(LocatorUtils.property(thisLocator, "relationshipNotes", lhsRelationshipNotes), LocatorUtils .property(thatLocator, "relationshipNotes", rhsRelationshipNotes), lhsRelationshipNotes, rhsRelationshipNotes)) { return false; } } { MaintenanceNotes lhsMaintenanceNotes; lhsMaintenanceNotes = this.getMaintenanceNotes(); MaintenanceNotes rhsMaintenanceNotes; rhsMaintenanceNotes = that.getMaintenanceNotes(); if (!strategy.equals(LocatorUtils.property(thisLocator, "maintenanceNotes", lhsMaintenanceNotes), LocatorUtils .property(thatLocator, "maintenanceNotes", rhsMaintenanceNotes), lhsMaintenanceNotes, rhsMaintenanceNotes)) { return false; } } { CompoundElement.BackgroundDetails lhsBackgroundDetails; lhsBackgroundDetails = this.getBackgroundDetails(); CompoundElement.BackgroundDetails rhsBackgroundDetails; rhsBackgroundDetails = that.getBackgroundDetails(); if (!strategy.equals(LocatorUtils.property(thisLocator, "backgroundDetails", lhsBackgroundDetails), LocatorUtils .property(thatLocator, "backgroundDetails", rhsBackgroundDetails), lhsBackgroundDetails, rhsBackgroundDetails)) { return false; } } { OtherNotes lhsOtherNotes; lhsOtherNotes = this.getOtherNotes(); OtherNotes rhsOtherNotes; rhsOtherNotes = that.getOtherNotes(); if (!strategy.equals(LocatorUtils.property(thisLocator, "otherNotes", lhsOtherNotes), LocatorUtils.property( thatLocator, "otherNotes", rhsOtherNotes), lhsOtherNotes, rhsOtherNotes)) { return false; } } { AlternateTerms lhsAlternateTerms; lhsAlternateTerms = this.getAlternateTerms(); AlternateTerms rhsAlternateTerms; rhsAlternateTerms = that.getAlternateTerms(); if (!strategy.equals(LocatorUtils.property(thisLocator, "alternateTerms", lhsAlternateTerms), LocatorUtils.property(thatLocator, "alternateTerms", rhsAlternateTerms), lhsAlternateTerms, rhsAlternateTerms)) { return false; } } { ResearchGaps lhsResearchGaps; lhsResearchGaps = this.getResearchGaps(); ResearchGaps rhsResearchGaps; rhsResearchGaps = that.getResearchGaps(); if (!strategy.equals(LocatorUtils.property(thisLocator, "researchGaps", lhsResearchGaps), LocatorUtils.property( thatLocator, "researchGaps", rhsResearchGaps), lhsResearchGaps, rhsResearchGaps)) { return false; } } { ReferenceListType lhsReferences; lhsReferences = this.getReferences(); ReferenceListType rhsReferences; rhsReferences = that.getReferences(); if (!strategy.equals(LocatorUtils.property(thisLocator, "references", lhsReferences), LocatorUtils.property( thatLocator, "references", rhsReferences), lhsReferences, rhsReferences)) { return false; } } { ContentHistory lhsContentHistory; lhsContentHistory = this.getContentHistory(); ContentHistory rhsContentHistory; rhsContentHistory = that.getContentHistory(); if (!strategy.equals(LocatorUtils.property(thisLocator, "contentHistory", lhsContentHistory), LocatorUtils.property(thatLocator, "contentHistory", rhsContentHistory), lhsContentHistory, rhsContentHistory)) { return false; } } { BigInteger lhsID; lhsID = this.getID(); BigInteger rhsID; rhsID = that.getID(); if (!strategy.equals( LocatorUtils.property(thisLocator, "id", lhsID), LocatorUtils.property(thatLocator, "id", rhsID), lhsID, rhsID)) { return false; } } { String lhsName; lhsName = this.getName(); String rhsName; rhsName = that.getName(); if (!strategy.equals( LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { return false; } } { String lhsCompoundElementAbstraction; lhsCompoundElementAbstraction = this .getCompoundElementAbstraction(); String rhsCompoundElementAbstraction; rhsCompoundElementAbstraction = that .getCompoundElementAbstraction(); if (!strategy.equals(LocatorUtils .property(thisLocator, "compoundElementAbstraction", lhsCompoundElementAbstraction), LocatorUtils .property(thatLocator, "compoundElementAbstraction", rhsCompoundElementAbstraction), lhsCompoundElementAbstraction, rhsCompoundElementAbstraction)) { return false; } } { String lhsCompoundElementCompleteness; lhsCompoundElementCompleteness = this .getCompoundElementCompleteness(); String rhsCompoundElementCompleteness; rhsCompoundElementCompleteness = that .getCompoundElementCompleteness(); if (!strategy.equals(LocatorUtils.property(thisLocator, "compoundElementCompleteness", lhsCompoundElementCompleteness), LocatorUtils.property( thatLocator, "compoundElementCompleteness", rhsCompoundElementCompleteness), lhsCompoundElementCompleteness, rhsCompoundElementCompleteness)) { return false; } } { String lhsCompoundElementStructure; lhsCompoundElementStructure = this.getCompoundElementStructure(); String rhsCompoundElementStructure; rhsCompoundElementStructure = that.getCompoundElementStructure(); if (!strategy.equals(LocatorUtils.property(thisLocator, "compoundElementStructure", lhsCompoundElementStructure), LocatorUtils.property(thatLocator, "compoundElementStructure", rhsCompoundElementStructure), lhsCompoundElementStructure, rhsCompoundElementStructure)) { return false; } } { StatusType lhsStatus; lhsStatus = this.getStatus(); StatusType rhsStatus; rhsStatus = that.getStatus(); if (!strategy.equals( LocatorUtils.property(thisLocator, "status", lhsStatus), LocatorUtils.property(thatLocator, "status", rhsStatus), lhsStatus, rhsStatus)) { return false; } } return true; } public boolean equals(Object object) { final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); } public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { CompoundElement.Description theDescription; theDescription = this.getDescription(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "description", theDescription), currentHashCode, theDescription); } { Relationships theRelationships; theRelationships = this.getRelationships(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "relationships", theRelationships), currentHashCode, theRelationships); } { RelationshipNotes theRelationshipNotes; theRelationshipNotes = this.getRelationshipNotes(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "relationshipNotes", theRelationshipNotes), currentHashCode, theRelationshipNotes); } { MaintenanceNotes theMaintenanceNotes; theMaintenanceNotes = this.getMaintenanceNotes(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "maintenanceNotes", theMaintenanceNotes), currentHashCode, theMaintenanceNotes); } { CompoundElement.BackgroundDetails theBackgroundDetails; theBackgroundDetails = this.getBackgroundDetails(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "backgroundDetails", theBackgroundDetails), currentHashCode, theBackgroundDetails); } { OtherNotes theOtherNotes; theOtherNotes = this.getOtherNotes(); currentHashCode = strategy .hashCode(LocatorUtils.property(locator, "otherNotes", theOtherNotes), currentHashCode, theOtherNotes); } { AlternateTerms theAlternateTerms; theAlternateTerms = this.getAlternateTerms(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "alternateTerms", theAlternateTerms), currentHashCode, theAlternateTerms); } { ResearchGaps theResearchGaps; theResearchGaps = this.getResearchGaps(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "researchGaps", theResearchGaps), currentHashCode, theResearchGaps); } { ReferenceListType theReferences; theReferences = this.getReferences(); currentHashCode = strategy .hashCode(LocatorUtils.property(locator, "references", theReferences), currentHashCode, theReferences); } { ContentHistory theContentHistory; theContentHistory = this.getContentHistory(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "contentHistory", theContentHistory), currentHashCode, theContentHistory); } { BigInteger theID; theID = this.getID(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "id", theID), currentHashCode, theID); } { String theName; theName = this.getName(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "name", theName), currentHashCode, theName); } { String theCompoundElementAbstraction; theCompoundElementAbstraction = this .getCompoundElementAbstraction(); currentHashCode = strategy.hashCode(LocatorUtils .property(locator, "compoundElementAbstraction", theCompoundElementAbstraction), currentHashCode, theCompoundElementAbstraction); } { String theCompoundElementCompleteness; theCompoundElementCompleteness = this .getCompoundElementCompleteness(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "compoundElementCompleteness", theCompoundElementCompleteness), currentHashCode, theCompoundElementCompleteness); } { String theCompoundElementStructure; theCompoundElementStructure = this.getCompoundElementStructure(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "compoundElementStructure", theCompoundElementStructure), currentHashCode, theCompoundElementStructure); } { StatusType theStatus; theStatus = this.getStatus(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus); } return currentHashCode; } public int hashCode() { final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); } public CompoundElement withDescription(CompoundElement.Description value) { setDescription(value); return this; } public CompoundElement withRelationships(Relationships value) { setRelationships(value); return this; } public CompoundElement withRelationshipNotes(RelationshipNotes value) { setRelationshipNotes(value); return this; } public CompoundElement withMaintenanceNotes(MaintenanceNotes value) { setMaintenanceNotes(value); return this; } public CompoundElement withBackgroundDetails( CompoundElement.BackgroundDetails value) { setBackgroundDetails(value); return this; } public CompoundElement withOtherNotes(OtherNotes value) { setOtherNotes(value); return this; } public CompoundElement withAlternateTerms(AlternateTerms value) { setAlternateTerms(value); return this; } public CompoundElement withResearchGaps(ResearchGaps value) { setResearchGaps(value); return this; } public CompoundElement withReferences(ReferenceListType value) { setReferences(value); return this; } public CompoundElement withContentHistory(ContentHistory value) { setContentHistory(value); return this; } public CompoundElement withID(BigInteger value) { setID(value); return this; } public CompoundElement withName(String value) { setName(value); return this; } public CompoundElement withCompoundElementAbstraction(String value) { setCompoundElementAbstraction(value); return this; } public CompoundElement withCompoundElementCompleteness(String value) { setCompoundElementCompleteness(value); return this; } public CompoundElement withCompoundElementStructure(String value) { setCompoundElementStructure(value); return this; } public CompoundElement withStatus(StatusType value) { setStatus(value); return this; } public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; } public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { CompoundElement.Description theDescription; theDescription = this.getDescription(); strategy.appendField(locator, this, "description", buffer, theDescription); } { Relationships theRelationships; theRelationships = this.getRelationships(); strategy.appendField(locator, this, "relationships", buffer, theRelationships); } { RelationshipNotes theRelationshipNotes; theRelationshipNotes = this.getRelationshipNotes(); strategy.appendField(locator, this, "relationshipNotes", buffer, theRelationshipNotes); } { MaintenanceNotes theMaintenanceNotes; theMaintenanceNotes = this.getMaintenanceNotes(); strategy.appendField(locator, this, "maintenanceNotes", buffer, theMaintenanceNotes); } { CompoundElement.BackgroundDetails theBackgroundDetails; theBackgroundDetails = this.getBackgroundDetails(); strategy.appendField(locator, this, "backgroundDetails", buffer, theBackgroundDetails); } { OtherNotes theOtherNotes; theOtherNotes = this.getOtherNotes(); strategy.appendField(locator, this, "otherNotes", buffer, theOtherNotes); } { AlternateTerms theAlternateTerms; theAlternateTerms = this.getAlternateTerms(); strategy.appendField(locator, this, "alternateTerms", buffer, theAlternateTerms); } { ResearchGaps theResearchGaps; theResearchGaps = this.getResearchGaps(); strategy.appendField(locator, this, "researchGaps", buffer, theResearchGaps); } { ReferenceListType theReferences; theReferences = this.getReferences(); strategy.appendField(locator, this, "references", buffer, theReferences); } { ContentHistory theContentHistory; theContentHistory = this.getContentHistory(); strategy.appendField(locator, this, "contentHistory", buffer, theContentHistory); } { BigInteger theID; theID = this.getID(); strategy.appendField(locator, this, "id", buffer, theID); } { String theName; theName = this.getName(); strategy.appendField(locator, this, "name", buffer, theName); } { String theCompoundElementAbstraction; theCompoundElementAbstraction = this .getCompoundElementAbstraction(); strategy.appendField(locator, this, "compoundElementAbstraction", buffer, theCompoundElementAbstraction); } { String theCompoundElementCompleteness; theCompoundElementCompleteness = this .getCompoundElementCompleteness(); strategy.appendField(locator, this, "compoundElementCompleteness", buffer, theCompoundElementCompleteness); } { String theCompoundElementStructure; theCompoundElementStructure = this.getCompoundElementStructure(); strategy.appendField(locator, this, "compoundElementStructure", buffer, theCompoundElementStructure); } { StatusType theStatus; theStatus = this.getStatus(); strategy.appendField(locator, this, "status", buffer, theStatus); } return buffer; } /** *

Java class for anonymous complex type. * *

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

	 * <complexType>
	 *   <complexContent>
	 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
	 *       <sequence>
	 *         <element name="Background_Detail" type="{http://capec.mitre.org/capec-2}Structured_Text_Type" maxOccurs="unbounded"/>
	 *       </sequence>
	 *     </restriction>
	 *   </complexContent>
	 * </complexType>
	 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "backgroundDetails" }) public static class BackgroundDetails implements Equals, HashCode, ToString { @XmlElement(name = "Background_Detail", required = true) protected List backgroundDetails; /** * Default no-arg constructor * */ public BackgroundDetails() { super(); } /** * Fully-initialising value constructor * */ public BackgroundDetails( final List backgroundDetails) { this.backgroundDetails = backgroundDetails; } /** * Gets the value of the backgroundDetails 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 backgroundDetails property. * *

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

		 *    getBackgroundDetails().add(newItem);
		 * 
* * *

* Objects of the following type(s) are allowed in the list * {@link StructuredTextType } * * */ public List getBackgroundDetails() { if (backgroundDetails == null) { backgroundDetails = new ArrayList(); } return this.backgroundDetails; } public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof CompoundElement.BackgroundDetails)) { return false; } if (this == object) { return true; } final CompoundElement.BackgroundDetails that = ((CompoundElement.BackgroundDetails) object); { List lhsBackgroundDetails; lhsBackgroundDetails = (((this.backgroundDetails != null) && (!this.backgroundDetails .isEmpty())) ? this.getBackgroundDetails() : null); List rhsBackgroundDetails; rhsBackgroundDetails = (((that.backgroundDetails != null) && (!that.backgroundDetails .isEmpty())) ? that.getBackgroundDetails() : null); if (!strategy.equals(LocatorUtils.property(thisLocator, "backgroundDetails", lhsBackgroundDetails), LocatorUtils.property(thatLocator, "backgroundDetails", rhsBackgroundDetails), lhsBackgroundDetails, rhsBackgroundDetails)) { return false; } } return true; } public boolean equals(Object object) { final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); } public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { List theBackgroundDetails; theBackgroundDetails = (((this.backgroundDetails != null) && (!this.backgroundDetails .isEmpty())) ? this.getBackgroundDetails() : null); currentHashCode = strategy.hashCode(LocatorUtils.property( locator, "backgroundDetails", theBackgroundDetails), currentHashCode, theBackgroundDetails); } return currentHashCode; } public int hashCode() { final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); } public CompoundElement.BackgroundDetails withBackgroundDetails( StructuredTextType... values) { if (values != null) { for (StructuredTextType value : values) { getBackgroundDetails().add(value); } } return this; } public CompoundElement.BackgroundDetails withBackgroundDetails( Collection values) { if (values != null) { getBackgroundDetails().addAll(values); } return this; } public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; } public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { List theBackgroundDetails; theBackgroundDetails = (((this.backgroundDetails != null) && (!this.backgroundDetails .isEmpty())) ? this.getBackgroundDetails() : null); strategy.appendField(locator, this, "backgroundDetails", buffer, theBackgroundDetails); } return buffer; } } /** *

Java class for anonymous complex type. * *

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

	 * <complexType>
	 *   <complexContent>
	 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
	 *       <sequence>
	 *         <element name="Description_Summary" type="{http://www.w3.org/2001/XMLSchema}string"/>
	 *         <element name="Extended_Description" type="{http://capec.mitre.org/capec-2}Structured_Text_Type" minOccurs="0"/>
	 *       </sequence>
	 *     </restriction>
	 *   </complexContent>
	 * </complexType>
	 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "descriptionSummary", "extendedDescription" }) public static class Description implements Equals, HashCode, ToString { @XmlElement(name = "Description_Summary", required = true) protected String descriptionSummary; @XmlElement(name = "Extended_Description") protected StructuredTextType extendedDescription; /** * Default no-arg constructor * */ public Description() { super(); } /** * Fully-initialising value constructor * */ public Description(final String descriptionSummary, final StructuredTextType extendedDescription) { this.descriptionSummary = descriptionSummary; this.extendedDescription = extendedDescription; } /** * Gets the value of the descriptionSummary property. * * @return * possible object is * {@link String } * */ public String getDescriptionSummary() { return descriptionSummary; } /** * Sets the value of the descriptionSummary property. * * @param value * allowed object is * {@link String } * */ public void setDescriptionSummary(String value) { this.descriptionSummary = value; } /** * Gets the value of the extendedDescription property. * * @return * possible object is * {@link StructuredTextType } * */ public StructuredTextType getExtendedDescription() { return extendedDescription; } /** * Sets the value of the extendedDescription property. * * @param value * allowed object is * {@link StructuredTextType } * */ public void setExtendedDescription(StructuredTextType value) { this.extendedDescription = value; } public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof CompoundElement.Description)) { return false; } if (this == object) { return true; } final CompoundElement.Description that = ((CompoundElement.Description) object); { String lhsDescriptionSummary; lhsDescriptionSummary = this.getDescriptionSummary(); String rhsDescriptionSummary; rhsDescriptionSummary = that.getDescriptionSummary(); if (!strategy.equals(LocatorUtils.property(thisLocator, "descriptionSummary", lhsDescriptionSummary), LocatorUtils.property(thatLocator, "descriptionSummary", rhsDescriptionSummary), lhsDescriptionSummary, rhsDescriptionSummary)) { return false; } } { StructuredTextType lhsExtendedDescription; lhsExtendedDescription = this.getExtendedDescription(); StructuredTextType rhsExtendedDescription; rhsExtendedDescription = that.getExtendedDescription(); if (!strategy.equals(LocatorUtils.property(thisLocator, "extendedDescription", lhsExtendedDescription), LocatorUtils.property(thatLocator, "extendedDescription", rhsExtendedDescription), lhsExtendedDescription, rhsExtendedDescription)) { return false; } } return true; } public boolean equals(Object object) { final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); } public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { String theDescriptionSummary; theDescriptionSummary = this.getDescriptionSummary(); currentHashCode = strategy.hashCode(LocatorUtils.property( locator, "descriptionSummary", theDescriptionSummary), currentHashCode, theDescriptionSummary); } { StructuredTextType theExtendedDescription; theExtendedDescription = this.getExtendedDescription(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "extendedDescription", theExtendedDescription), currentHashCode, theExtendedDescription); } return currentHashCode; } public int hashCode() { final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); } public CompoundElement.Description withDescriptionSummary(String value) { setDescriptionSummary(value); return this; } public CompoundElement.Description withExtendedDescription( StructuredTextType value) { setExtendedDescription(value); return this; } public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; } public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { String theDescriptionSummary; theDescriptionSummary = this.getDescriptionSummary(); strategy.appendField(locator, this, "descriptionSummary", buffer, theDescriptionSummary); } { StructuredTextType theExtendedDescription; theExtendedDescription = this.getExtendedDescription(); strategy.appendField(locator, this, "extendedDescription", buffer, theExtendedDescription); } return buffer; } } /** * Returns A Document representation of this instance that is not formatted. * * @return The Document representation for this instance. */ public org.w3c.dom.Document toDocument() { return toDocument(false); } /** * Returns A Document representation for this instance. * * @param prettyPrint * True for pretty print, otherwise false * * @return The Document representation for this instance. */ public org.w3c.dom.Document toDocument(boolean prettyPrint) { return DocumentUtilities.toDocument(toJAXBElement(), prettyPrint); } /** * Returns JAXBElement for this instance. * * @return The JAXBElement for this instance. */ @SuppressWarnings({ "rawtypes", "unchecked" }) public JAXBElement toJAXBElement() { QName qualifiedName = STIXSchema.getQualifiedName(this); return new JAXBElement(qualifiedName, CompoundElement.class, this); } /** * Returns String representation of this instance that is not formatted. * * @return The String containing the XML mark-up. */ public String toXMLString() { return toXMLString(false); } /** * Returns XML String for JAXB Document Object Model object. * * @param prettyPrint * True for pretty print, otherwise false * * @return The String containing the XML mark-up. */ public String toXMLString(boolean prettyPrint) { return DocumentUtilities.toXMLString(toDocument(), prettyPrint); } /** * Creates CompoundElement instance for XML String * * @param text * XML String for the document * @return The CompoundElement instance for the passed XML String */ public static CompoundElement fromXMLString(String text) { JAXBContext jaxbContext; try { jaxbContext = JAXBContext.newInstance(CompoundElement.class .getPackage().getName()); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller.setSchema(STIXSchema.getInstance().getSchema()); unmarshaller.setEventHandler(new ValidationEventHandler()); StreamSource streamSource = new StreamSource(new StringReader(text)); return (CompoundElement) unmarshaller.unmarshal(streamSource); } catch (JAXBException e) { throw new RuntimeException(e); } } /** * Validates the XML representation of this CompoundElement instance * Returning true indicating a successful validation, false if not. * * @return boolean True If it validates against the schema * @throws SAXException * If the a validation ErrorHandler has not been set, and * validation throws a SAXException */ public boolean validate() throws SAXException { return STIXSchema.getInstance().validate(toXMLString()); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy