001package org.schemastore.json.sarif.x210; 002 003import gov.nist.secauto.metaschema.core.datatype.adapter.IntegerAdapter; 004import gov.nist.secauto.metaschema.core.model.IBoundObject; 005import gov.nist.secauto.metaschema.core.model.IMetaschemaData; 006import gov.nist.secauto.metaschema.core.model.constraint.IConstraint; 007import gov.nist.secauto.metaschema.databind.model.annotations.BoundAssembly; 008import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; 009import gov.nist.secauto.metaschema.databind.model.annotations.Expect; 010import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; 011import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; 012import java.lang.Override; 013import java.lang.String; 014import java.math.BigInteger; 015import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 016import org.apache.commons.lang3.builder.ToStringStyle; 017 018/** 019 * A location within a programming artifact. 020 */ 021@MetaschemaAssembly( 022 formalName = "Location", 023 description = "A location within a programming artifact.", 024 name = "location", 025 moduleClass = SarifModule.class, 026 valueConstraints = @ValueConstraints(expect = @Expect(level = IConstraint.Level.ERROR, test = "@id >= -1", message = "The id '{ . }' is not greater than or equal to '-1'.")) 027) 028public class Location implements IBoundObject { 029 private final IMetaschemaData __metaschemaData; 030 031 /** 032 * "A value that distinguishes this location from all other locations within a single result object." 033 */ 034 @BoundFlag( 035 formalName = "Location Identifier", 036 description = "A value that distinguishes this location from all other locations within a single result object.", 037 name = "id", 038 defaultValue = "-1", 039 typeAdapter = IntegerAdapter.class 040 ) 041 private BigInteger _id; 042 043 @BoundAssembly( 044 formalName = "Physical Location", 045 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.", 046 useName = "physicalLocation" 047 ) 048 private PhysicalLocation _physicalLocation; 049 050 @BoundAssembly( 051 formalName = "Logical Location", 052 description = "The logical locations associated with the result.", 053 useName = "logicalLocation" 054 ) 055 private LogicalLocation _logicalLocation; 056 057 @BoundAssembly( 058 formalName = "Location Message", 059 description = "A message relevant to the location.", 060 useName = "message" 061 ) 062 private Message _message; 063 064 public Location() { 065 this(null); 066 } 067 068 public Location(IMetaschemaData data) { 069 this.__metaschemaData = data; 070 } 071 072 @Override 073 public IMetaschemaData getMetaschemaData() { 074 return __metaschemaData; 075 } 076 077 public BigInteger getId() { 078 return _id; 079 } 080 081 public void setId(BigInteger value) { 082 _id = value; 083 } 084 085 public PhysicalLocation getPhysicalLocation() { 086 return _physicalLocation; 087 } 088 089 public void setPhysicalLocation(PhysicalLocation value) { 090 _physicalLocation = value; 091 } 092 093 public LogicalLocation getLogicalLocation() { 094 return _logicalLocation; 095 } 096 097 public void setLogicalLocation(LogicalLocation value) { 098 _logicalLocation = value; 099 } 100 101 public Message getMessage() { 102 return _message; 103 } 104 105 public void setMessage(Message value) { 106 _message = value; 107 } 108 109 @Override 110 public String toString() { 111 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 112 } 113}