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

org.mitre.cybox.objects.WindowsSystem Maven / Gradle / Ivy

The 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:19:53 PM EDT 
//

package org.mitre.cybox.objects;

import java.io.StringReader;
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.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.cybox.common_2.CustomPropertiesType;
import org.mitre.cybox.common_2.DateObjectPropertyType;
import org.mitre.cybox.common_2.DurationObjectPropertyType;
import org.mitre.cybox.common_2.StringObjectPropertyType;
import org.mitre.cybox.common_2.TimeObjectPropertyType;
import org.mitre.cybox.common_2.UnsignedLongObjectPropertyType;
import org.mitre.stix.DocumentUtilities;
import org.mitre.stix.STIXSchema;
import org.mitre.stix.ValidationEventHandler;
import org.xml.sax.SAXException;

/**
 * The WindowsSystemObjectType type is intended to characterize Windows systems.
 * 
 * 

Java class for WindowsSystemObjectType complex type. * *

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

 * <complexType name="WindowsSystemObjectType">
 *   <complexContent>
 *     <extension base="{http://cybox.mitre.org/objects#SystemObject-2}SystemObjectType">
 *       <sequence>
 *         <element name="Domain" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" maxOccurs="unbounded" minOccurs="0"/>
 *         <element name="Global_Flag_List" type="{http://cybox.mitre.org/objects#WinSystemObject-2}GlobalFlagListType" minOccurs="0"/>
 *         <element name="NetBIOS_Name" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" minOccurs="0"/>
 *         <element name="Open_Handle_List" type="{http://cybox.mitre.org/objects#WinHandleObject-2}WindowsHandleListType" minOccurs="0"/>
 *         <element name="Product_ID" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" minOccurs="0"/>
 *         <element name="Product_Name" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" minOccurs="0"/>
 *         <element name="Registered_Organization" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" minOccurs="0"/>
 *         <element name="Registered_Owner" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" minOccurs="0"/>
 *         <element name="Windows_Directory" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" minOccurs="0"/>
 *         <element name="Windows_System_Directory" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" minOccurs="0"/>
 *         <element name="Windows_Temp_Directory" type="{http://cybox.mitre.org/common-2}StringObjectPropertyType" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "WindowsSystemObjectType", namespace = "http://cybox.mitre.org/objects#WinSystemObject-2", propOrder = { "domains", "globalFlagList", "netBIOSName", "openHandleList", "productID", "productName", "registeredOrganization", "registeredOwner", "windowsDirectory", "windowsSystemDirectory", "windowsTempDirectory" }) @XmlRootElement(name = "Windows_System", namespace = "http://cybox.mitre.org/objects#WinSystemObject-2") public class WindowsSystem extends SystemObjectType implements Equals, HashCode, ToString { @XmlElement(name = "Domain") protected List domains; @XmlElement(name = "Global_Flag_List") protected GlobalFlagListType globalFlagList; @XmlElement(name = "NetBIOS_Name") protected StringObjectPropertyType netBIOSName; @XmlElement(name = "Open_Handle_List") protected WindowsHandleListType openHandleList; @XmlElement(name = "Product_ID") protected StringObjectPropertyType productID; @XmlElement(name = "Product_Name") protected StringObjectPropertyType productName; @XmlElement(name = "Registered_Organization") protected StringObjectPropertyType registeredOrganization; @XmlElement(name = "Registered_Owner") protected StringObjectPropertyType registeredOwner; @XmlElement(name = "Windows_Directory") protected StringObjectPropertyType windowsDirectory; @XmlElement(name = "Windows_System_Directory") protected StringObjectPropertyType windowsSystemDirectory; @XmlElement(name = "Windows_Temp_Directory") protected StringObjectPropertyType windowsTempDirectory; /** * Default no-arg constructor * */ public WindowsSystem() { super(); } /** * Fully-initialising value constructor * */ public WindowsSystem(final CustomPropertiesType customProperties, final QName objectReference, final UnsignedLongObjectPropertyType availablePhysicalMemory, final BIOSInfoType biosInfo, final DateObjectPropertyType date, final StringObjectPropertyType hostname, final TimeObjectPropertyType localTime, final NetworkInterfaceListType networkInterfaceList, final OSType os, final StringObjectPropertyType processor, final ProcessorArchType processorArchitecture, final TimeObjectPropertyType systemTime, final StringObjectPropertyType timezoneDST, final StringObjectPropertyType timezoneStandard, final UnsignedLongObjectPropertyType totalPhysicalMemory, final DurationObjectPropertyType uptime, final StringObjectPropertyType username, final List domains, final GlobalFlagListType globalFlagList, final StringObjectPropertyType netBIOSName, final WindowsHandleListType openHandleList, final StringObjectPropertyType productID, final StringObjectPropertyType productName, final StringObjectPropertyType registeredOrganization, final StringObjectPropertyType registeredOwner, final StringObjectPropertyType windowsDirectory, final StringObjectPropertyType windowsSystemDirectory, final StringObjectPropertyType windowsTempDirectory) { super(customProperties, objectReference, availablePhysicalMemory, biosInfo, date, hostname, localTime, networkInterfaceList, os, processor, processorArchitecture, systemTime, timezoneDST, timezoneStandard, totalPhysicalMemory, uptime, username); this.domains = domains; this.globalFlagList = globalFlagList; this.netBIOSName = netBIOSName; this.openHandleList = openHandleList; this.productID = productID; this.productName = productName; this.registeredOrganization = registeredOrganization; this.registeredOwner = registeredOwner; this.windowsDirectory = windowsDirectory; this.windowsSystemDirectory = windowsSystemDirectory; this.windowsTempDirectory = windowsTempDirectory; } /** * Gets the value of the domains 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 domains property. * *

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

	 *    getDomains().add(newItem);
	 * 
* * *

* Objects of the following type(s) are allowed in the list * {@link StringObjectPropertyType } * * */ public List getDomains() { if (domains == null) { domains = new ArrayList(); } return this.domains; } /** * Gets the value of the globalFlagList property. * * @return * possible object is * {@link GlobalFlagListType } * */ public GlobalFlagListType getGlobalFlagList() { return globalFlagList; } /** * Sets the value of the globalFlagList property. * * @param value * allowed object is * {@link GlobalFlagListType } * */ public void setGlobalFlagList(GlobalFlagListType value) { this.globalFlagList = value; } /** * Gets the value of the netBIOSName property. * * @return * possible object is * {@link StringObjectPropertyType } * */ public StringObjectPropertyType getNetBIOSName() { return netBIOSName; } /** * Sets the value of the netBIOSName property. * * @param value * allowed object is * {@link StringObjectPropertyType } * */ public void setNetBIOSName(StringObjectPropertyType value) { this.netBIOSName = value; } /** * Gets the value of the openHandleList property. * * @return * possible object is * {@link WindowsHandleListType } * */ public WindowsHandleListType getOpenHandleList() { return openHandleList; } /** * Sets the value of the openHandleList property. * * @param value * allowed object is * {@link WindowsHandleListType } * */ public void setOpenHandleList(WindowsHandleListType value) { this.openHandleList = value; } /** * Gets the value of the productID property. * * @return * possible object is * {@link StringObjectPropertyType } * */ public StringObjectPropertyType getProductID() { return productID; } /** * Sets the value of the productID property. * * @param value * allowed object is * {@link StringObjectPropertyType } * */ public void setProductID(StringObjectPropertyType value) { this.productID = value; } /** * Gets the value of the productName property. * * @return * possible object is * {@link StringObjectPropertyType } * */ public StringObjectPropertyType getProductName() { return productName; } /** * Sets the value of the productName property. * * @param value * allowed object is * {@link StringObjectPropertyType } * */ public void setProductName(StringObjectPropertyType value) { this.productName = value; } /** * Gets the value of the registeredOrganization property. * * @return * possible object is * {@link StringObjectPropertyType } * */ public StringObjectPropertyType getRegisteredOrganization() { return registeredOrganization; } /** * Sets the value of the registeredOrganization property. * * @param value * allowed object is * {@link StringObjectPropertyType } * */ public void setRegisteredOrganization(StringObjectPropertyType value) { this.registeredOrganization = value; } /** * Gets the value of the registeredOwner property. * * @return * possible object is * {@link StringObjectPropertyType } * */ public StringObjectPropertyType getRegisteredOwner() { return registeredOwner; } /** * Sets the value of the registeredOwner property. * * @param value * allowed object is * {@link StringObjectPropertyType } * */ public void setRegisteredOwner(StringObjectPropertyType value) { this.registeredOwner = value; } /** * Gets the value of the windowsDirectory property. * * @return * possible object is * {@link StringObjectPropertyType } * */ public StringObjectPropertyType getWindowsDirectory() { return windowsDirectory; } /** * Sets the value of the windowsDirectory property. * * @param value * allowed object is * {@link StringObjectPropertyType } * */ public void setWindowsDirectory(StringObjectPropertyType value) { this.windowsDirectory = value; } /** * Gets the value of the windowsSystemDirectory property. * * @return * possible object is * {@link StringObjectPropertyType } * */ public StringObjectPropertyType getWindowsSystemDirectory() { return windowsSystemDirectory; } /** * Sets the value of the windowsSystemDirectory property. * * @param value * allowed object is * {@link StringObjectPropertyType } * */ public void setWindowsSystemDirectory(StringObjectPropertyType value) { this.windowsSystemDirectory = value; } /** * Gets the value of the windowsTempDirectory property. * * @return * possible object is * {@link StringObjectPropertyType } * */ public StringObjectPropertyType getWindowsTempDirectory() { return windowsTempDirectory; } /** * Sets the value of the windowsTempDirectory property. * * @param value * allowed object is * {@link StringObjectPropertyType } * */ public void setWindowsTempDirectory(StringObjectPropertyType value) { this.windowsTempDirectory = value; } public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof WindowsSystem)) { return false; } if (this == object) { return true; } if (!super.equals(thisLocator, thatLocator, object, strategy)) { return false; } final WindowsSystem that = ((WindowsSystem) object); { List lhsDomains; lhsDomains = (((this.domains != null) && (!this.domains.isEmpty())) ? this .getDomains() : null); List rhsDomains; rhsDomains = (((that.domains != null) && (!that.domains.isEmpty())) ? that .getDomains() : null); if (!strategy.equals( LocatorUtils.property(thisLocator, "domains", lhsDomains), LocatorUtils.property(thatLocator, "domains", rhsDomains), lhsDomains, rhsDomains)) { return false; } } { GlobalFlagListType lhsGlobalFlagList; lhsGlobalFlagList = this.getGlobalFlagList(); GlobalFlagListType rhsGlobalFlagList; rhsGlobalFlagList = that.getGlobalFlagList(); if (!strategy.equals(LocatorUtils.property(thisLocator, "globalFlagList", lhsGlobalFlagList), LocatorUtils.property(thatLocator, "globalFlagList", rhsGlobalFlagList), lhsGlobalFlagList, rhsGlobalFlagList)) { return false; } } { StringObjectPropertyType lhsNetBIOSName; lhsNetBIOSName = this.getNetBIOSName(); StringObjectPropertyType rhsNetBIOSName; rhsNetBIOSName = that.getNetBIOSName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "netBIOSName", lhsNetBIOSName), LocatorUtils.property( thatLocator, "netBIOSName", rhsNetBIOSName), lhsNetBIOSName, rhsNetBIOSName)) { return false; } } { WindowsHandleListType lhsOpenHandleList; lhsOpenHandleList = this.getOpenHandleList(); WindowsHandleListType rhsOpenHandleList; rhsOpenHandleList = that.getOpenHandleList(); if (!strategy.equals(LocatorUtils.property(thisLocator, "openHandleList", lhsOpenHandleList), LocatorUtils.property(thatLocator, "openHandleList", rhsOpenHandleList), lhsOpenHandleList, rhsOpenHandleList)) { return false; } } { StringObjectPropertyType lhsProductID; lhsProductID = this.getProductID(); StringObjectPropertyType rhsProductID; rhsProductID = that.getProductID(); if (!strategy.equals(LocatorUtils.property(thisLocator, "productID", lhsProductID), LocatorUtils.property( thatLocator, "productID", rhsProductID), lhsProductID, rhsProductID)) { return false; } } { StringObjectPropertyType lhsProductName; lhsProductName = this.getProductName(); StringObjectPropertyType rhsProductName; rhsProductName = that.getProductName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "productName", lhsProductName), LocatorUtils.property( thatLocator, "productName", rhsProductName), lhsProductName, rhsProductName)) { return false; } } { StringObjectPropertyType lhsRegisteredOrganization; lhsRegisteredOrganization = this.getRegisteredOrganization(); StringObjectPropertyType rhsRegisteredOrganization; rhsRegisteredOrganization = that.getRegisteredOrganization(); if (!strategy.equals(LocatorUtils.property(thisLocator, "registeredOrganization", lhsRegisteredOrganization), LocatorUtils .property(thatLocator, "registeredOrganization", rhsRegisteredOrganization), lhsRegisteredOrganization, rhsRegisteredOrganization)) { return false; } } { StringObjectPropertyType lhsRegisteredOwner; lhsRegisteredOwner = this.getRegisteredOwner(); StringObjectPropertyType rhsRegisteredOwner; rhsRegisteredOwner = that.getRegisteredOwner(); if (!strategy.equals(LocatorUtils.property(thisLocator, "registeredOwner", lhsRegisteredOwner), LocatorUtils .property(thatLocator, "registeredOwner", rhsRegisteredOwner), lhsRegisteredOwner, rhsRegisteredOwner)) { return false; } } { StringObjectPropertyType lhsWindowsDirectory; lhsWindowsDirectory = this.getWindowsDirectory(); StringObjectPropertyType rhsWindowsDirectory; rhsWindowsDirectory = that.getWindowsDirectory(); if (!strategy.equals(LocatorUtils.property(thisLocator, "windowsDirectory", lhsWindowsDirectory), LocatorUtils .property(thatLocator, "windowsDirectory", rhsWindowsDirectory), lhsWindowsDirectory, rhsWindowsDirectory)) { return false; } } { StringObjectPropertyType lhsWindowsSystemDirectory; lhsWindowsSystemDirectory = this.getWindowsSystemDirectory(); StringObjectPropertyType rhsWindowsSystemDirectory; rhsWindowsSystemDirectory = that.getWindowsSystemDirectory(); if (!strategy.equals(LocatorUtils.property(thisLocator, "windowsSystemDirectory", lhsWindowsSystemDirectory), LocatorUtils .property(thatLocator, "windowsSystemDirectory", rhsWindowsSystemDirectory), lhsWindowsSystemDirectory, rhsWindowsSystemDirectory)) { return false; } } { StringObjectPropertyType lhsWindowsTempDirectory; lhsWindowsTempDirectory = this.getWindowsTempDirectory(); StringObjectPropertyType rhsWindowsTempDirectory; rhsWindowsTempDirectory = that.getWindowsTempDirectory(); if (!strategy.equals(LocatorUtils.property(thisLocator, "windowsTempDirectory", lhsWindowsTempDirectory), LocatorUtils.property(thatLocator, "windowsTempDirectory", rhsWindowsTempDirectory), lhsWindowsTempDirectory, rhsWindowsTempDirectory)) { 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 = super.hashCode(locator, strategy); { List theDomains; theDomains = (((this.domains != null) && (!this.domains.isEmpty())) ? this .getDomains() : null); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "domains", theDomains), currentHashCode, theDomains); } { GlobalFlagListType theGlobalFlagList; theGlobalFlagList = this.getGlobalFlagList(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "globalFlagList", theGlobalFlagList), currentHashCode, theGlobalFlagList); } { StringObjectPropertyType theNetBIOSName; theNetBIOSName = this.getNetBIOSName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "netBIOSName", theNetBIOSName), currentHashCode, theNetBIOSName); } { WindowsHandleListType theOpenHandleList; theOpenHandleList = this.getOpenHandleList(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "openHandleList", theOpenHandleList), currentHashCode, theOpenHandleList); } { StringObjectPropertyType theProductID; theProductID = this.getProductID(); currentHashCode = strategy.hashCode( LocatorUtils.property(locator, "productID", theProductID), currentHashCode, theProductID); } { StringObjectPropertyType theProductName; theProductName = this.getProductName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "productName", theProductName), currentHashCode, theProductName); } { StringObjectPropertyType theRegisteredOrganization; theRegisteredOrganization = this.getRegisteredOrganization(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "registeredOrganization", theRegisteredOrganization), currentHashCode, theRegisteredOrganization); } { StringObjectPropertyType theRegisteredOwner; theRegisteredOwner = this.getRegisteredOwner(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "registeredOwner", theRegisteredOwner), currentHashCode, theRegisteredOwner); } { StringObjectPropertyType theWindowsDirectory; theWindowsDirectory = this.getWindowsDirectory(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "windowsDirectory", theWindowsDirectory), currentHashCode, theWindowsDirectory); } { StringObjectPropertyType theWindowsSystemDirectory; theWindowsSystemDirectory = this.getWindowsSystemDirectory(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "windowsSystemDirectory", theWindowsSystemDirectory), currentHashCode, theWindowsSystemDirectory); } { StringObjectPropertyType theWindowsTempDirectory; theWindowsTempDirectory = this.getWindowsTempDirectory(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "windowsTempDirectory", theWindowsTempDirectory), currentHashCode, theWindowsTempDirectory); } return currentHashCode; } public int hashCode() { final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); } public WindowsSystem withDomains(StringObjectPropertyType... values) { if (values != null) { for (StringObjectPropertyType value : values) { getDomains().add(value); } } return this; } public WindowsSystem withDomains(Collection values) { if (values != null) { getDomains().addAll(values); } return this; } public WindowsSystem withGlobalFlagList(GlobalFlagListType value) { setGlobalFlagList(value); return this; } public WindowsSystem withNetBIOSName(StringObjectPropertyType value) { setNetBIOSName(value); return this; } public WindowsSystem withOpenHandleList(WindowsHandleListType value) { setOpenHandleList(value); return this; } public WindowsSystem withProductID(StringObjectPropertyType value) { setProductID(value); return this; } public WindowsSystem withProductName(StringObjectPropertyType value) { setProductName(value); return this; } public WindowsSystem withRegisteredOrganization( StringObjectPropertyType value) { setRegisteredOrganization(value); return this; } public WindowsSystem withRegisteredOwner(StringObjectPropertyType value) { setRegisteredOwner(value); return this; } public WindowsSystem withWindowsDirectory(StringObjectPropertyType value) { setWindowsDirectory(value); return this; } public WindowsSystem withWindowsSystemDirectory( StringObjectPropertyType value) { setWindowsSystemDirectory(value); return this; } public WindowsSystem withWindowsTempDirectory(StringObjectPropertyType value) { setWindowsTempDirectory(value); return this; } @Override public WindowsSystem withAvailablePhysicalMemory( UnsignedLongObjectPropertyType value) { setAvailablePhysicalMemory(value); return this; } @Override public WindowsSystem withBIOSInfo(BIOSInfoType value) { setBIOSInfo(value); return this; } @Override public WindowsSystem withDate(DateObjectPropertyType value) { setDate(value); return this; } @Override public WindowsSystem withHostname(StringObjectPropertyType value) { setHostname(value); return this; } @Override public WindowsSystem withLocalTime(TimeObjectPropertyType value) { setLocalTime(value); return this; } @Override public WindowsSystem withNetworkInterfaceList(NetworkInterfaceListType value) { setNetworkInterfaceList(value); return this; } @Override public WindowsSystem withOS(OSType value) { setOS(value); return this; } @Override public WindowsSystem withProcessor(StringObjectPropertyType value) { setProcessor(value); return this; } @Override public WindowsSystem withProcessorArchitecture(ProcessorArchType value) { setProcessorArchitecture(value); return this; } @Override public WindowsSystem withSystemTime(TimeObjectPropertyType value) { setSystemTime(value); return this; } @Override public WindowsSystem withTimezoneDST(StringObjectPropertyType value) { setTimezoneDST(value); return this; } @Override public WindowsSystem withTimezoneStandard(StringObjectPropertyType value) { setTimezoneStandard(value); return this; } @Override public WindowsSystem withTotalPhysicalMemory( UnsignedLongObjectPropertyType value) { setTotalPhysicalMemory(value); return this; } @Override public WindowsSystem withUptime(DurationObjectPropertyType value) { setUptime(value); return this; } @Override public WindowsSystem withUsername(StringObjectPropertyType value) { setUsername(value); return this; } @Override public WindowsSystem withCustomProperties(CustomPropertiesType value) { setCustomProperties(value); return this; } @Override public WindowsSystem withObjectReference(QName value) { setObjectReference(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) { super.appendFields(locator, buffer, strategy); { List theDomains; theDomains = (((this.domains != null) && (!this.domains.isEmpty())) ? this .getDomains() : null); strategy.appendField(locator, this, "domains", buffer, theDomains); } { GlobalFlagListType theGlobalFlagList; theGlobalFlagList = this.getGlobalFlagList(); strategy.appendField(locator, this, "globalFlagList", buffer, theGlobalFlagList); } { StringObjectPropertyType theNetBIOSName; theNetBIOSName = this.getNetBIOSName(); strategy.appendField(locator, this, "netBIOSName", buffer, theNetBIOSName); } { WindowsHandleListType theOpenHandleList; theOpenHandleList = this.getOpenHandleList(); strategy.appendField(locator, this, "openHandleList", buffer, theOpenHandleList); } { StringObjectPropertyType theProductID; theProductID = this.getProductID(); strategy.appendField(locator, this, "productID", buffer, theProductID); } { StringObjectPropertyType theProductName; theProductName = this.getProductName(); strategy.appendField(locator, this, "productName", buffer, theProductName); } { StringObjectPropertyType theRegisteredOrganization; theRegisteredOrganization = this.getRegisteredOrganization(); strategy.appendField(locator, this, "registeredOrganization", buffer, theRegisteredOrganization); } { StringObjectPropertyType theRegisteredOwner; theRegisteredOwner = this.getRegisteredOwner(); strategy.appendField(locator, this, "registeredOwner", buffer, theRegisteredOwner); } { StringObjectPropertyType theWindowsDirectory; theWindowsDirectory = this.getWindowsDirectory(); strategy.appendField(locator, this, "windowsDirectory", buffer, theWindowsDirectory); } { StringObjectPropertyType theWindowsSystemDirectory; theWindowsSystemDirectory = this.getWindowsSystemDirectory(); strategy.appendField(locator, this, "windowsSystemDirectory", buffer, theWindowsSystemDirectory); } { StringObjectPropertyType theWindowsTempDirectory; theWindowsTempDirectory = this.getWindowsTempDirectory(); strategy.appendField(locator, this, "windowsTempDirectory", buffer, theWindowsTempDirectory); } 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, WindowsSystem.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 WindowsSystem instance for XML String * * @param text * XML String for the document * @return The WindowsSystem instance for the passed XML String */ public static WindowsSystem fromXMLString(String text) { JAXBContext jaxbContext; try { jaxbContext = JAXBContext.newInstance(WindowsSystem.class .getPackage().getName()); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller.setSchema(STIXSchema.getInstance().getSchema()); unmarshaller.setEventHandler(new ValidationEventHandler()); StreamSource streamSource = new StreamSource(new StringReader(text)); return (WindowsSystem) unmarshaller.unmarshal(streamSource); } catch (JAXBException e) { throw new RuntimeException(e); } } /** * Validates the XML representation of this WindowsSystem 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