org.mitre.capec.capec_2.AttackExecutionFlow Maven / Gradle / Ivy
Show all versions of stix Show documentation
/**
* 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:19:53 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.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
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="Attack_Phases">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Attack_Phase" maxOccurs="3">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Attack_Steps">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Attack_Step" maxOccurs="unbounded">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <choice>
* <element name="Common_Attack_Step">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Pattern_Specific_Overrides" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </sequence>
* <attribute name="Common_Attack_Step_ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Custom_Attack_Step" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </choice>
* <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* <attribute name="Name" use="required">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}token">
* <whiteSpace value="collapse"/>
* <enumeration value="Explore"/>
* <enumeration value="Experiment"/>
* <enumeration value="Exploit"/>
* <enumeration value=""/>
* </restriction>
* </simpleType>
* </attribute>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "attackPhases" })
@XmlRootElement(name = "Attack_Execution_Flow")
public class AttackExecutionFlow implements Equals, HashCode, ToString {
@XmlElement(name = "Attack_Phases", required = true)
protected AttackExecutionFlow.AttackPhases attackPhases;
/**
* Default no-arg constructor
*
*/
public AttackExecutionFlow() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public AttackExecutionFlow(
final AttackExecutionFlow.AttackPhases attackPhases) {
this.attackPhases = attackPhases;
}
/**
* Gets the value of the attackPhases property.
*
* @return
* possible object is
* {@link AttackExecutionFlow.AttackPhases }
*
*/
public AttackExecutionFlow.AttackPhases getAttackPhases() {
return attackPhases;
}
/**
* Sets the value of the attackPhases property.
*
* @param value
* allowed object is
* {@link AttackExecutionFlow.AttackPhases }
*
*/
public void setAttackPhases(AttackExecutionFlow.AttackPhases value) {
this.attackPhases = value;
}
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator,
Object object, EqualsStrategy strategy) {
if (!(object instanceof AttackExecutionFlow)) {
return false;
}
if (this == object) {
return true;
}
final AttackExecutionFlow that = ((AttackExecutionFlow) object);
{
AttackExecutionFlow.AttackPhases lhsAttackPhases;
lhsAttackPhases = this.getAttackPhases();
AttackExecutionFlow.AttackPhases rhsAttackPhases;
rhsAttackPhases = that.getAttackPhases();
if (!strategy.equals(LocatorUtils.property(thisLocator,
"attackPhases", lhsAttackPhases), LocatorUtils.property(
thatLocator, "attackPhases", rhsAttackPhases),
lhsAttackPhases, rhsAttackPhases)) {
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;
{
AttackExecutionFlow.AttackPhases theAttackPhases;
theAttackPhases = this.getAttackPhases();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator,
"attackPhases", theAttackPhases), currentHashCode,
theAttackPhases);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public AttackExecutionFlow withAttackPhases(
AttackExecutionFlow.AttackPhases value) {
setAttackPhases(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) {
{
AttackExecutionFlow.AttackPhases theAttackPhases;
theAttackPhases = this.getAttackPhases();
strategy.appendField(locator, this, "attackPhases", buffer,
theAttackPhases);
}
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="Attack_Phase" maxOccurs="3">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Attack_Steps">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Attack_Step" maxOccurs="unbounded">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <choice>
* <element name="Common_Attack_Step">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Pattern_Specific_Overrides" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </sequence>
* <attribute name="Common_Attack_Step_ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Custom_Attack_Step" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </choice>
* <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* <attribute name="Name" use="required">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}token">
* <whiteSpace value="collapse"/>
* <enumeration value="Explore"/>
* <enumeration value="Experiment"/>
* <enumeration value="Exploit"/>
* <enumeration value=""/>
* </restriction>
* </simpleType>
* </attribute>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "attackPhases" })
public static class AttackPhases implements Equals, HashCode, ToString {
@XmlElement(name = "Attack_Phase", required = true)
protected List attackPhases;
/**
* Default no-arg constructor
*
*/
public AttackPhases() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public AttackPhases(
final List attackPhases) {
this.attackPhases = attackPhases;
}
/**
* Gets the value of the attackPhases 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 attackPhases property.
*
*
* For example, to add a new item, do as follows:
*
* getAttackPhases().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link AttackExecutionFlow.AttackPhases.AttackPhase }
*
*
*/
public List getAttackPhases() {
if (attackPhases == null) {
attackPhases = new ArrayList();
}
return this.attackPhases;
}
public boolean equals(ObjectLocator thisLocator,
ObjectLocator thatLocator, Object object,
EqualsStrategy strategy) {
if (!(object instanceof AttackExecutionFlow.AttackPhases)) {
return false;
}
if (this == object) {
return true;
}
final AttackExecutionFlow.AttackPhases that = ((AttackExecutionFlow.AttackPhases) object);
{
List lhsAttackPhases;
lhsAttackPhases = (((this.attackPhases != null) && (!this.attackPhases
.isEmpty())) ? this.getAttackPhases() : null);
List rhsAttackPhases;
rhsAttackPhases = (((that.attackPhases != null) && (!that.attackPhases
.isEmpty())) ? that.getAttackPhases() : null);
if (!strategy.equals(LocatorUtils.property(thisLocator,
"attackPhases", lhsAttackPhases),
LocatorUtils.property(thatLocator, "attackPhases",
rhsAttackPhases), lhsAttackPhases,
rhsAttackPhases)) {
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 theAttackPhases;
theAttackPhases = (((this.attackPhases != null) && (!this.attackPhases
.isEmpty())) ? this.getAttackPhases() : null);
currentHashCode = strategy.hashCode(LocatorUtils.property(
locator, "attackPhases", theAttackPhases),
currentHashCode, theAttackPhases);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public AttackExecutionFlow.AttackPhases withAttackPhases(
AttackExecutionFlow.AttackPhases.AttackPhase... values) {
if (values != null) {
for (AttackExecutionFlow.AttackPhases.AttackPhase value : values) {
getAttackPhases().add(value);
}
}
return this;
}
public AttackExecutionFlow.AttackPhases withAttackPhases(
Collection values) {
if (values != null) {
getAttackPhases().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 theAttackPhases;
theAttackPhases = (((this.attackPhases != null) && (!this.attackPhases
.isEmpty())) ? this.getAttackPhases() : null);
strategy.appendField(locator, this, "attackPhases", buffer,
theAttackPhases);
}
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="Attack_Steps">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Attack_Step" maxOccurs="unbounded">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <choice>
* <element name="Common_Attack_Step">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Pattern_Specific_Overrides" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </sequence>
* <attribute name="Common_Attack_Step_ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Custom_Attack_Step" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </choice>
* <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* <attribute name="Name" use="required">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}token">
* <whiteSpace value="collapse"/>
* <enumeration value="Explore"/>
* <enumeration value="Experiment"/>
* <enumeration value="Exploit"/>
* <enumeration value=""/>
* </restriction>
* </simpleType>
* </attribute>
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "attackSteps" })
public static class AttackPhase implements Equals, HashCode, ToString {
@XmlElement(name = "Attack_Steps", required = true)
protected AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps attackSteps;
@XmlAttribute(name = "ID", required = true)
protected BigInteger id;
@XmlAttribute(name = "Name", required = true)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String name;
/**
* Default no-arg constructor
*
*/
public AttackPhase() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public AttackPhase(
final AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps attackSteps,
final BigInteger id, final String name) {
this.attackSteps = attackSteps;
this.id = id;
this.name = name;
}
/**
* Gets the value of the attackSteps property.
*
* @return
* possible object is
* {@link AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps }
*
*/
public AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps getAttackSteps() {
return attackSteps;
}
/**
* Sets the value of the attackSteps property.
*
* @param value
* allowed object is
* {@link AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps }
*
*/
public void setAttackSteps(
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps value) {
this.attackSteps = 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;
}
public boolean equals(ObjectLocator thisLocator,
ObjectLocator thatLocator, Object object,
EqualsStrategy strategy) {
if (!(object instanceof AttackExecutionFlow.AttackPhases.AttackPhase)) {
return false;
}
if (this == object) {
return true;
}
final AttackExecutionFlow.AttackPhases.AttackPhase that = ((AttackExecutionFlow.AttackPhases.AttackPhase) object);
{
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps lhsAttackSteps;
lhsAttackSteps = this.getAttackSteps();
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps rhsAttackSteps;
rhsAttackSteps = that.getAttackSteps();
if (!strategy.equals(LocatorUtils.property(thisLocator,
"attackSteps", lhsAttackSteps), LocatorUtils
.property(thatLocator, "attackSteps",
rhsAttackSteps), lhsAttackSteps,
rhsAttackSteps)) {
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;
}
}
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;
{
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps theAttackSteps;
theAttackSteps = this.getAttackSteps();
currentHashCode = strategy.hashCode(LocatorUtils.property(
locator, "attackSteps", theAttackSteps),
currentHashCode, theAttackSteps);
}
{
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);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public AttackExecutionFlow.AttackPhases.AttackPhase withAttackSteps(
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps value) {
setAttackSteps(value);
return this;
}
public AttackExecutionFlow.AttackPhases.AttackPhase withID(
BigInteger value) {
setID(value);
return this;
}
public AttackExecutionFlow.AttackPhases.AttackPhase withName(
String value) {
setName(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) {
{
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps theAttackSteps;
theAttackSteps = this.getAttackSteps();
strategy.appendField(locator, this, "attackSteps", buffer,
theAttackSteps);
}
{
BigInteger theID;
theID = this.getID();
strategy.appendField(locator, this, "id", buffer, theID);
}
{
String theName;
theName = this.getName();
strategy.appendField(locator, this, "name", buffer, theName);
}
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="Attack_Step" maxOccurs="unbounded">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <choice>
* <element name="Common_Attack_Step">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Pattern_Specific_Overrides" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </sequence>
* <attribute name="Common_Attack_Step_ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Custom_Attack_Step" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </choice>
* <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "attackSteps" })
public static class AttackSteps implements Equals, HashCode,
ToString {
@XmlElement(name = "Attack_Step", required = true)
protected List attackSteps;
/**
* Default no-arg constructor
*
*/
public AttackSteps() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public AttackSteps(
final List attackSteps) {
this.attackSteps = attackSteps;
}
/**
* Gets the value of the attackSteps 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 attackSteps property.
*
*
* For example, to add a new item, do as follows:
*
* getAttackSteps().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep }
*
*
*/
public List getAttackSteps() {
if (attackSteps == null) {
attackSteps = new ArrayList();
}
return this.attackSteps;
}
public boolean equals(ObjectLocator thisLocator,
ObjectLocator thatLocator, Object object,
EqualsStrategy strategy) {
if (!(object instanceof AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps)) {
return false;
}
if (this == object) {
return true;
}
final AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps that = ((AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps) object);
{
List lhsAttackSteps;
lhsAttackSteps = (((this.attackSteps != null) && (!this.attackSteps
.isEmpty())) ? this.getAttackSteps() : null);
List rhsAttackSteps;
rhsAttackSteps = (((that.attackSteps != null) && (!that.attackSteps
.isEmpty())) ? that.getAttackSteps() : null);
if (!strategy.equals(LocatorUtils.property(thisLocator,
"attackSteps", lhsAttackSteps), LocatorUtils
.property(thatLocator, "attackSteps",
rhsAttackSteps), lhsAttackSteps,
rhsAttackSteps)) {
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 theAttackSteps;
theAttackSteps = (((this.attackSteps != null) && (!this.attackSteps
.isEmpty())) ? this.getAttackSteps() : null);
currentHashCode = strategy.hashCode(LocatorUtils
.property(locator, "attackSteps",
theAttackSteps), currentHashCode,
theAttackSteps);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps withAttackSteps(
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep... values) {
if (values != null) {
for (AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep value : values) {
getAttackSteps().add(value);
}
}
return this;
}
public AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps withAttackSteps(
Collection values) {
if (values != null) {
getAttackSteps().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 theAttackSteps;
theAttackSteps = (((this.attackSteps != null) && (!this.attackSteps
.isEmpty())) ? this.getAttackSteps() : null);
strategy.appendField(locator, this, "attackSteps",
buffer, theAttackSteps);
}
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">
* <choice>
* <element name="Common_Attack_Step">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Pattern_Specific_Overrides" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </sequence>
* <attribute name="Common_Attack_Step_ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Custom_Attack_Step" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </choice>
* <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "customAttackStep",
"commonAttackStep" })
public static class AttackStep implements Equals, HashCode,
ToString {
@XmlElement(name = "Custom_Attack_Step")
protected CustomAttackStepType customAttackStep;
@XmlElement(name = "Common_Attack_Step")
protected AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep commonAttackStep;
@XmlAttribute(name = "ID", required = true)
protected BigInteger id;
/**
* Default no-arg constructor
*
*/
public AttackStep() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public AttackStep(
final CustomAttackStepType customAttackStep,
final AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep commonAttackStep,
final BigInteger id) {
this.customAttackStep = customAttackStep;
this.commonAttackStep = commonAttackStep;
this.id = id;
}
/**
* Gets the value of the customAttackStep property.
*
* @return
* possible object is
* {@link CustomAttackStepType }
*
*/
public CustomAttackStepType getCustomAttackStep() {
return customAttackStep;
}
/**
* Sets the value of the customAttackStep property.
*
* @param value
* allowed object is
* {@link CustomAttackStepType }
*
*/
public void setCustomAttackStep(CustomAttackStepType value) {
this.customAttackStep = value;
}
/**
* Gets the value of the commonAttackStep property.
*
* @return
* possible object is
* {@link AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep }
*
*/
public AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep getCommonAttackStep() {
return commonAttackStep;
}
/**
* Sets the value of the commonAttackStep property.
*
* @param value
* allowed object is
* {@link AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep }
*
*/
public void setCommonAttackStep(
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep value) {
this.commonAttackStep = 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;
}
public boolean equals(ObjectLocator thisLocator,
ObjectLocator thatLocator, Object object,
EqualsStrategy strategy) {
if (!(object instanceof AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep)) {
return false;
}
if (this == object) {
return true;
}
final AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep that = ((AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep) object);
{
CustomAttackStepType lhsCustomAttackStep;
lhsCustomAttackStep = this.getCustomAttackStep();
CustomAttackStepType rhsCustomAttackStep;
rhsCustomAttackStep = that.getCustomAttackStep();
if (!strategy.equals(LocatorUtils.property(
thisLocator, "customAttackStep",
lhsCustomAttackStep), LocatorUtils
.property(thatLocator, "customAttackStep",
rhsCustomAttackStep),
lhsCustomAttackStep, rhsCustomAttackStep)) {
return false;
}
}
{
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep lhsCommonAttackStep;
lhsCommonAttackStep = this.getCommonAttackStep();
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep rhsCommonAttackStep;
rhsCommonAttackStep = that.getCommonAttackStep();
if (!strategy.equals(LocatorUtils.property(
thisLocator, "commonAttackStep",
lhsCommonAttackStep), LocatorUtils
.property(thatLocator, "commonAttackStep",
rhsCommonAttackStep),
lhsCommonAttackStep, rhsCommonAttackStep)) {
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;
}
}
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;
{
CustomAttackStepType theCustomAttackStep;
theCustomAttackStep = this.getCustomAttackStep();
currentHashCode = strategy.hashCode(LocatorUtils
.property(locator, "customAttackStep",
theCustomAttackStep),
currentHashCode, theCustomAttackStep);
}
{
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep theCommonAttackStep;
theCommonAttackStep = this.getCommonAttackStep();
currentHashCode = strategy.hashCode(LocatorUtils
.property(locator, "commonAttackStep",
theCommonAttackStep),
currentHashCode, theCommonAttackStep);
}
{
BigInteger theID;
theID = this.getID();
currentHashCode = strategy
.hashCode(LocatorUtils.property(locator,
"id", theID), currentHashCode,
theID);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep withCustomAttackStep(
CustomAttackStepType value) {
setCustomAttackStep(value);
return this;
}
public AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep withCommonAttackStep(
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep value) {
setCommonAttackStep(value);
return this;
}
public AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep withID(
BigInteger value) {
setID(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) {
{
CustomAttackStepType theCustomAttackStep;
theCustomAttackStep = this.getCustomAttackStep();
strategy.appendField(locator, this,
"customAttackStep", buffer,
theCustomAttackStep);
}
{
AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep theCommonAttackStep;
theCommonAttackStep = this.getCommonAttackStep();
strategy.appendField(locator, this,
"commonAttackStep", buffer,
theCommonAttackStep);
}
{
BigInteger theID;
theID = this.getID();
strategy.appendField(locator, this, "id", buffer,
theID);
}
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="Pattern_Specific_Overrides" type="{http://capec.mitre.org/capec-2}Custom_Attack_StepType"/>
* </sequence>
* <attribute name="Common_Attack_Step_ID" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "patternSpecificOverrides" })
public static class CommonAttackStep implements Equals,
HashCode, ToString {
@XmlElement(name = "Pattern_Specific_Overrides", required = true)
protected CustomAttackStepType patternSpecificOverrides;
@XmlAttribute(name = "Common_Attack_Step_ID", required = true)
protected BigInteger commonAttackStepID;
/**
* Default no-arg constructor
*
*/
public CommonAttackStep() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public CommonAttackStep(
final CustomAttackStepType patternSpecificOverrides,
final BigInteger commonAttackStepID) {
this.patternSpecificOverrides = patternSpecificOverrides;
this.commonAttackStepID = commonAttackStepID;
}
/**
* Gets the value of the patternSpecificOverrides property.
*
* @return
* possible object is
* {@link CustomAttackStepType }
*
*/
public CustomAttackStepType getPatternSpecificOverrides() {
return patternSpecificOverrides;
}
/**
* Sets the value of the patternSpecificOverrides property.
*
* @param value
* allowed object is
* {@link CustomAttackStepType }
*
*/
public void setPatternSpecificOverrides(
CustomAttackStepType value) {
this.patternSpecificOverrides = value;
}
/**
* Gets the value of the commonAttackStepID property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getCommonAttackStepID() {
return commonAttackStepID;
}
/**
* Sets the value of the commonAttackStepID property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setCommonAttackStepID(BigInteger value) {
this.commonAttackStepID = value;
}
public boolean equals(ObjectLocator thisLocator,
ObjectLocator thatLocator, Object object,
EqualsStrategy strategy) {
if (!(object instanceof AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep)) {
return false;
}
if (this == object) {
return true;
}
final AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep that = ((AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep) object);
{
CustomAttackStepType lhsPatternSpecificOverrides;
lhsPatternSpecificOverrides = this
.getPatternSpecificOverrides();
CustomAttackStepType rhsPatternSpecificOverrides;
rhsPatternSpecificOverrides = that
.getPatternSpecificOverrides();
if (!strategy.equals(LocatorUtils.property(
thisLocator,
"patternSpecificOverrides",
lhsPatternSpecificOverrides),
LocatorUtils.property(thatLocator,
"patternSpecificOverrides",
rhsPatternSpecificOverrides),
lhsPatternSpecificOverrides,
rhsPatternSpecificOverrides)) {
return false;
}
}
{
BigInteger lhsCommonAttackStepID;
lhsCommonAttackStepID = this
.getCommonAttackStepID();
BigInteger rhsCommonAttackStepID;
rhsCommonAttackStepID = that
.getCommonAttackStepID();
if (!strategy.equals(LocatorUtils.property(
thisLocator, "commonAttackStepID",
lhsCommonAttackStepID), LocatorUtils
.property(thatLocator,
"commonAttackStepID",
rhsCommonAttackStepID),
lhsCommonAttackStepID,
rhsCommonAttackStepID)) {
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;
{
CustomAttackStepType thePatternSpecificOverrides;
thePatternSpecificOverrides = this
.getPatternSpecificOverrides();
currentHashCode = strategy.hashCode(
LocatorUtils.property(locator,
"patternSpecificOverrides",
thePatternSpecificOverrides),
currentHashCode,
thePatternSpecificOverrides);
}
{
BigInteger theCommonAttackStepID;
theCommonAttackStepID = this
.getCommonAttackStepID();
currentHashCode = strategy.hashCode(
LocatorUtils.property(locator,
"commonAttackStepID",
theCommonAttackStepID),
currentHashCode, theCommonAttackStepID);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep withPatternSpecificOverrides(
CustomAttackStepType value) {
setPatternSpecificOverrides(value);
return this;
}
public AttackExecutionFlow.AttackPhases.AttackPhase.AttackSteps.AttackStep.CommonAttackStep withCommonAttackStepID(
BigInteger value) {
setCommonAttackStepID(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) {
{
CustomAttackStepType thePatternSpecificOverrides;
thePatternSpecificOverrides = this
.getPatternSpecificOverrides();
strategy.appendField(locator, this,
"patternSpecificOverrides", buffer,
thePatternSpecificOverrides);
}
{
BigInteger theCommonAttackStepID;
theCommonAttackStepID = this
.getCommonAttackStepID();
strategy.appendField(locator, this,
"commonAttackStepID", buffer,
theCommonAttackStepID);
}
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, AttackExecutionFlow.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 AttackExecutionFlow instance for XML String
*
* @param text
* XML String for the document
* @return The AttackExecutionFlow instance for the passed XML String
*/
public static AttackExecutionFlow fromXMLString(String text) {
JAXBContext jaxbContext;
try {
jaxbContext = JAXBContext.newInstance(AttackExecutionFlow.class
.getPackage().getName());
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setSchema(STIXSchema.getInstance().getSchema());
unmarshaller.setEventHandler(new ValidationEventHandler());
StreamSource streamSource = new StreamSource(new StringReader(text));
return (AttackExecutionFlow) unmarshaller.unmarshal(streamSource);
} catch (JAXBException e) {
throw new RuntimeException(e);
}
}
/**
* Validates the XML representation of this AttackExecutionFlow 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());
}
}