001package org.schemastore.json.sarif.x210; 002 003import gov.nist.secauto.metaschema.core.model.IBoundObject; 004import gov.nist.secauto.metaschema.core.model.IMetaschemaData; 005import gov.nist.secauto.metaschema.core.model.constraint.IConstraint; 006import gov.nist.secauto.metaschema.databind.model.annotations.BoundAssembly; 007import gov.nist.secauto.metaschema.databind.model.annotations.Expect; 008import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; 009import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; 010import java.lang.Override; 011import java.lang.String; 012import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 013import org.apache.commons.lang3.builder.ToStringStyle; 014 015/** 016 * A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact. 017 */ 018@MetaschemaAssembly( 019 formalName = "Physical Location", 020 description = "A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.", 021 name = "physicalLocation", 022 moduleClass = SarifModule.class, 023 valueConstraints = @ValueConstraints(expect = @Expect(level = IConstraint.Level.ERROR, test = "exists(address|artifactLocation)", message = "At least one address or artifactLocation must be provided.")) 024) 025public class PhysicalLocation implements IBoundObject { 026 private final IMetaschemaData __metaschemaData; 027 028 @BoundAssembly( 029 formalName = "Address", 030 description = "A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file).", 031 useName = "address" 032 ) 033 private Address _address; 034 035 @BoundAssembly( 036 formalName = "Artifact Location", 037 description = "The location of the artifact.", 038 useName = "artifactLocation" 039 ) 040 private ArtifactLocation _artifactLocation; 041 042 @BoundAssembly( 043 formalName = "Region", 044 description = "Specifies a portion of the artifact.", 045 useName = "region" 046 ) 047 private Region _region; 048 049 @BoundAssembly( 050 formalName = "Context Region", 051 description = "Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region.", 052 useName = "contextRegion" 053 ) 054 private Region _contextRegion; 055 056 public PhysicalLocation() { 057 this(null); 058 } 059 060 public PhysicalLocation(IMetaschemaData data) { 061 this.__metaschemaData = data; 062 } 063 064 @Override 065 public IMetaschemaData getMetaschemaData() { 066 return __metaschemaData; 067 } 068 069 public Address getAddress() { 070 return _address; 071 } 072 073 public void setAddress(Address value) { 074 _address = value; 075 } 076 077 public ArtifactLocation getArtifactLocation() { 078 return _artifactLocation; 079 } 080 081 public void setArtifactLocation(ArtifactLocation value) { 082 _artifactLocation = value; 083 } 084 085 public Region getRegion() { 086 return _region; 087 } 088 089 public void setRegion(Region value) { 090 _region = value; 091 } 092 093 public Region getContextRegion() { 094 return _contextRegion; 095 } 096 097 public void setContextRegion(Region value) { 098 _contextRegion = value; 099 } 100 101 @Override 102 public String toString() { 103 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 104 } 105 106 /** 107 * A physical or virtual address, or a range of addresses, in an ‘addressable region’ (memory or a binary file). 108 */ 109 @MetaschemaAssembly( 110 formalName = "Address", 111 description = "A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file).", 112 name = "address", 113 moduleClass = SarifModule.class 114 ) 115 public static class Address implements IBoundObject { 116 private final IMetaschemaData __metaschemaData; 117 118 public Address() { 119 this(null); 120 } 121 122 public Address(IMetaschemaData data) { 123 this.__metaschemaData = data; 124 } 125 126 @Override 127 public IMetaschemaData getMetaschemaData() { 128 return __metaschemaData; 129 } 130 131 @Override 132 public String toString() { 133 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 134 } 135 } 136}