org.mitre.cybox.common_2.ObjectFactory 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.cybox.common_2;
import java.io.StringReader;
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.XmlRegistry;
import javax.xml.namespace.QName;
import javax.xml.transform.stream.StreamSource;
import org.mitre.stix.DocumentUtilities;
import org.mitre.stix.STIXSchema;
import org.mitre.stix.ValidationEventHandler;
import org.xml.sax.SAXException;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the org.mitre.cybox.common_2 package.
* An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.mitre.cybox.common_2
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link CustomPropertiesType }
*
*/
public CustomPropertiesType createCustomPropertiesType() {
return new CustomPropertiesType();
}
/**
* Create an instance of {@link PositiveIntegerObjectPropertyType }
*
*/
public PositiveIntegerObjectPropertyType createPositiveIntegerObjectPropertyType() {
return new PositiveIntegerObjectPropertyType();
}
/**
* Create an instance of {@link Layer4ProtocolType }
*
*/
public Layer4ProtocolType createLayer4ProtocolType() {
return new Layer4ProtocolType();
}
/**
* Create an instance of {@link ErrorsType }
*
*/
public ErrorsType createErrorsType() {
return new ErrorsType();
}
/**
* Create an instance of {@link DurationObjectPropertyType }
*
*/
public DurationObjectPropertyType createDurationObjectPropertyType() {
return new DurationObjectPropertyType();
}
/**
* Create an instance of {@link IntegerObjectPropertyType }
*
*/
public IntegerObjectPropertyType createIntegerObjectPropertyType() {
return new IntegerObjectPropertyType();
}
/**
* Create an instance of {@link PatternableFieldType }
*
*/
public PatternableFieldType createPatternableFieldType() {
return new PatternableFieldType();
}
/**
* Create an instance of {@link BuildInformationType }
*
*/
public BuildInformationType createBuildInformationType() {
return new BuildInformationType();
}
/**
* Create an instance of {@link SIDType }
*
*/
public SIDType createSIDType() {
return new SIDType();
}
/**
* Create an instance of {@link DependencyType }
*
*/
public DependencyType createDependencyType() {
return new DependencyType();
}
/**
* Create an instance of {@link CipherType }
*
*/
public CipherType createCipherType() {
return new CipherType();
}
/**
* Create an instance of {@link UnsignedLongObjectPropertyType }
*
*/
public UnsignedLongObjectPropertyType createUnsignedLongObjectPropertyType() {
return new UnsignedLongObjectPropertyType();
}
/**
* Create an instance of {@link DigitalSignaturesType }
*
*/
public DigitalSignaturesType createDigitalSignaturesType() {
return new DigitalSignaturesType();
}
/**
* Create an instance of {@link RegionalRegistryType }
*
*/
public RegionalRegistryType createRegionalRegistryType() {
return new RegionalRegistryType();
}
/**
* Create an instance of {@link UnsignedIntegerObjectPropertyType }
*
*/
public UnsignedIntegerObjectPropertyType createUnsignedIntegerObjectPropertyType() {
return new UnsignedIntegerObjectPropertyType();
}
/**
* Create an instance of {@link AnyURIObjectPropertyType }
*
*/
public AnyURIObjectPropertyType createAnyURIObjectPropertyType() {
return new AnyURIObjectPropertyType();
}
/**
* Create an instance of {@link HashType }
*
*/
public HashType createHashType() {
return new HashType();
}
/**
* Create an instance of {@link LibrariesType }
*
*/
public LibrariesType createLibrariesType() {
return new LibrariesType();
}
/**
* Create an instance of {@link ContributorType }
*
*/
public ContributorType createContributorType() {
return new ContributorType();
}
/**
* Create an instance of {@link ExtractedStringType }
*
*/
public ExtractedStringType createExtractedStringType() {
return new ExtractedStringType();
}
/**
* Create an instance of {@link HashValueType }
*
*/
public HashValueType createHashValueType() {
return new HashValueType();
}
/**
* Create an instance of {@link ToolInformationType }
*
*/
public ToolInformationType createToolInformationType() {
return new ToolInformationType();
}
/**
* Create an instance of {@link ByteRunType }
*
*/
public ByteRunType createByteRunType() {
return new ByteRunType();
}
/**
* Create an instance of {@link HashListType }
*
*/
public HashListType createHashListType() {
return new HashListType();
}
/**
* Create an instance of {@link EndiannessType }
*
*/
public EndiannessType createEndiannessType() {
return new EndiannessType();
}
/**
* Create an instance of {@link CompilerInformalDescriptionType }
*
*/
public CompilerInformalDescriptionType createCompilerInformalDescriptionType() {
return new CompilerInformalDescriptionType();
}
/**
* Create an instance of {@link DateWithPrecisionType }
*
*/
public DateWithPrecisionType createDateWithPrecisionType() {
return new DateWithPrecisionType();
}
/**
* Create an instance of {@link FunctionsType }
*
*/
public FunctionsType createFunctionsType() {
return new FunctionsType();
}
/**
* Create an instance of {@link DependenciesType }
*
*/
public DependenciesType createDependenciesType() {
return new DependenciesType();
}
/**
* Create an instance of {@link CompilersType }
*
*/
public CompilersType createCompilersType() {
return new CompilersType();
}
/**
* Create an instance of {@link ErrorType }
*
*/
public ErrorType createErrorType() {
return new ErrorType();
}
/**
* Create an instance of {@link StringObjectPropertyType }
*
*/
public StringObjectPropertyType createStringObjectPropertyType() {
return new StringObjectPropertyType();
}
/**
* Create an instance of {@link DateObjectPropertyRestrictionType }
*
*/
public DateObjectPropertyRestrictionType createDateObjectPropertyRestrictionType() {
return new DateObjectPropertyRestrictionType();
}
/**
* Create an instance of {@link ByteRunsType }
*
*/
public ByteRunsType createByteRunsType() {
return new ByteRunsType();
}
/**
* Create an instance of {@link BuildUtilityType }
*
*/
public BuildUtilityType createBuildUtilityType() {
return new BuildUtilityType();
}
/**
* Create an instance of {@link LibraryType }
*
*/
public LibraryType createLibraryType() {
return new LibraryType();
}
/**
* Create an instance of {@link DateTimeWithPrecisionType }
*
*/
public DateTimeWithPrecisionType createDateTimeWithPrecisionType() {
return new DateTimeWithPrecisionType();
}
/**
* Create an instance of {@link InternalStringsType }
*
*/
public InternalStringsType createInternalStringsType() {
return new InternalStringsType();
}
/**
* Create an instance of {@link TimeObjectPropertyType }
*
*/
public TimeObjectPropertyType createTimeObjectPropertyType() {
return new TimeObjectPropertyType();
}
/**
* Create an instance of {@link ConfigurationSettingType }
*
*/
public ConfigurationSettingType createConfigurationSettingType() {
return new ConfigurationSettingType();
}
/**
* Create an instance of {@link ExecutionEnvironmentType }
*
*/
public ExecutionEnvironmentType createExecutionEnvironmentType() {
return new ExecutionEnvironmentType();
}
/**
* Create an instance of {@link DataSegmentType }
*
*/
public DataSegmentType createDataSegmentType() {
return new DataSegmentType();
}
/**
* Create an instance of {@link Base64BinaryObjectPropertyType }
*
*/
public Base64BinaryObjectPropertyType createBase64BinaryObjectPropertyType() {
return new Base64BinaryObjectPropertyType();
}
/**
* Create an instance of {@link Property }
*
*/
public Property createProperty() {
return new Property();
}
/**
* Create an instance of {@link DateObjectPropertyType }
*
*/
public DateObjectPropertyType createDateObjectPropertyType() {
return new DateObjectPropertyType();
}
/**
* Create an instance of {@link HashSegmentType }
*
*/
public HashSegmentType createHashSegmentType() {
return new HashSegmentType();
}
/**
* Create an instance of {@link ExtractedStringsType }
*
*/
public ExtractedStringsType createExtractedStringsType() {
return new ExtractedStringsType();
}
/**
* Create an instance of {@link CodeSnippetsType }
*
*/
public CodeSnippetsType createCodeSnippetsType() {
return new CodeSnippetsType();
}
/**
* Create an instance of {@link NameObjectPropertyType }
*
*/
public NameObjectPropertyType createNameObjectPropertyType() {
return new NameObjectPropertyType();
}
/**
* Create an instance of {@link DataSizeType }
*
*/
public DataSizeType createDataSizeType() {
return new DataSizeType();
}
/**
* Create an instance of {@link MetadataType }
*
*/
public MetadataType createMetadataType() {
return new MetadataType();
}
/**
* Create an instance of {@link ImportsType }
*
*/
public ImportsType createImportsType() {
return new ImportsType();
}
/**
* Create an instance of {@link NonNegativeIntegerObjectPropertyType }
*
*/
public NonNegativeIntegerObjectPropertyType createNonNegativeIntegerObjectPropertyType() {
return new NonNegativeIntegerObjectPropertyType();
}
/**
* Create an instance of {@link FuzzyHashBlockType }
*
*/
public FuzzyHashBlockType createFuzzyHashBlockType() {
return new FuzzyHashBlockType();
}
/**
* Create an instance of {@link DateRangeType }
*
*/
public DateRangeType createDateRangeType() {
return new DateRangeType();
}
/**
* Create an instance of {@link CompilerType }
*
*/
public CompilerType createCompilerType() {
return new CompilerType();
}
/**
* Create an instance of {@link PlatformSpecificationType }
*
*/
public PlatformSpecificationType createPlatformSpecificationType() {
return new PlatformSpecificationType();
}
/**
* Create an instance of {@link UsageContextAssumptionsType }
*
*/
public UsageContextAssumptionsType createUsageContextAssumptionsType() {
return new UsageContextAssumptionsType();
}
/**
* Create an instance of {@link LongObjectPropertyType }
*
*/
public LongObjectPropertyType createLongObjectPropertyType() {
return new LongObjectPropertyType();
}
/**
* Create an instance of {@link DigitalSignatureInfoType }
*
*/
public DigitalSignatureInfoType createDigitalSignatureInfoType() {
return new DigitalSignatureInfoType();
}
/**
* Create an instance of {@link CompensationModelType }
*
*/
public CompensationModelType createCompensationModelType() {
return new CompensationModelType();
}
/**
* Create an instance of {@link FuzzyHashStructureType }
*
*/
public FuzzyHashStructureType createFuzzyHashStructureType() {
return new FuzzyHashStructureType();
}
/**
* Create an instance of {@link ErrorInstancesType }
*
*/
public ErrorInstancesType createErrorInstancesType() {
return new ErrorInstancesType();
}
/**
* Create an instance of {@link TimeType }
*
*/
public TimeType createTimeType() {
return new TimeType();
}
/**
* Create an instance of {@link ToolReferencesType }
*
*/
public ToolReferencesType createToolReferencesType() {
return new ToolReferencesType();
}
/**
* Create an instance of {@link InternationalizationSettingsType }
*
*/
public InternationalizationSettingsType createInternationalizationSettingsType() {
return new InternationalizationSettingsType();
}
/**
* Create an instance of {@link BuildConfigurationType }
*
*/
public BuildConfigurationType createBuildConfigurationType() {
return new BuildConfigurationType();
}
/**
* Create an instance of {@link FloatObjectPropertyType }
*
*/
public FloatObjectPropertyType createFloatObjectPropertyType() {
return new FloatObjectPropertyType();
}
/**
* Create an instance of {@link HexBinaryObjectPropertyType }
*
*/
public HexBinaryObjectPropertyType createHexBinaryObjectPropertyType() {
return new HexBinaryObjectPropertyType();
}
/**
* Create an instance of {@link EnvironmentVariableType }
*
*/
public EnvironmentVariableType createEnvironmentVariableType() {
return new EnvironmentVariableType();
}
/**
* Create an instance of {@link ConfigurationSettingsType }
*
*/
public ConfigurationSettingsType createConfigurationSettingsType() {
return new ConfigurationSettingsType();
}
/**
* Create an instance of {@link DoubleObjectPropertyType }
*
*/
public DoubleObjectPropertyType createDoubleObjectPropertyType() {
return new DoubleObjectPropertyType();
}
/**
* Create an instance of {@link DateTimeObjectPropertyType }
*
*/
public DateTimeObjectPropertyType createDateTimeObjectPropertyType() {
return new DateTimeObjectPropertyType();
}
/**
* Create an instance of {@link ToolConfigurationType }
*
*/
public ToolConfigurationType createToolConfigurationType() {
return new ToolConfigurationType();
}
/**
* Create an instance of {@link EnvironmentVariableListType }
*
*/
public EnvironmentVariableListType createEnvironmentVariableListType() {
return new EnvironmentVariableListType();
}
/**
* Create an instance of {@link MeasureSourceType }
*
*/
public MeasureSourceType createMeasureSourceType() {
return new MeasureSourceType();
}
/**
* Create an instance of {@link FuzzyHashValueType }
*
*/
public FuzzyHashValueType createFuzzyHashValueType() {
return new FuzzyHashValueType();
}
/**
* Create an instance of {@link ToolsInformationType }
*
*/
public ToolsInformationType createToolsInformationType() {
return new ToolsInformationType();
}
/**
* Create an instance of {@link ControlledVocabularyStringType }
*
*/
public ControlledVocabularyStringType createControlledVocabularyStringType() {
return new ControlledVocabularyStringType();
}
/**
* Create an instance of {@link PersonnelType }
*
*/
public PersonnelType createPersonnelType() {
return new PersonnelType();
}
/**
* Create an instance of {@link ToolReferenceType }
*
*/
public ToolReferenceType createToolReferenceType() {
return new ToolReferenceType();
}
/**
* Create an instance of {@link StructuredTextType }
*
*/
public StructuredTextType createStructuredTextType() {
return new StructuredTextType();
}
/**
* Create an instance of {@link HashSegmentsType }
*
*/
public HashSegmentsType createHashSegmentsType() {
return new HashSegmentsType();
}
/**
* Create an instance of {@link SimpleHashValueType }
*
*/
public SimpleHashValueType createSimpleHashValueType() {
return new SimpleHashValueType();
}
/**
* Create an instance of {@link PlatformIdentifierType }
*
*/
public PlatformIdentifierType createPlatformIdentifierType() {
return new PlatformIdentifierType();
}
/**
* Create an instance of {@link ExtractedFeaturesType }
*
*/
public ExtractedFeaturesType createExtractedFeaturesType() {
return new ExtractedFeaturesType();
}
/**
* Create an instance of {@link LocationType }
*
*/
public LocationType createLocationType() {
return new LocationType();
}
/**
* 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, ObjectFactory.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 ObjectFactory instance for XML String
*
* @param text
* XML String for the document
* @return The ObjectFactory instance for the passed XML String
*/
public static ObjectFactory fromXMLString(String text) {
JAXBContext jaxbContext;
try {
jaxbContext = JAXBContext.newInstance(ObjectFactory.class
.getPackage().getName());
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setSchema(STIXSchema.getInstance().getSchema());
unmarshaller.setEventHandler(new ValidationEventHandler());
StreamSource streamSource = new StreamSource(new StringReader(text));
return (ObjectFactory) unmarshaller.unmarshal(streamSource);
} catch (JAXBException e) {
throw new RuntimeException(e);
}
}
/**
* Validates the XML representation of this ObjectFactory 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());
}
}