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.BoundField; 008import gov.nist.secauto.metaschema.databind.model.annotations.Expect; 009import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; 010import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; 011import java.lang.Override; 012import java.lang.String; 013import java.math.BigInteger; 014import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 015import org.apache.commons.lang3.builder.ToStringStyle; 016 017/** 018 * A logical location of a construct that produced a result. 019 */ 020@MetaschemaAssembly( 021 formalName = "Logical Location", 022 description = "A logical location of a construct that produced a result.", 023 name = "logicalLocation", 024 moduleClass = SarifModule.class 025) 026public class LogicalLocation implements IBoundObject { 027 private final IMetaschemaData __metaschemaData; 028 029 @BoundField( 030 formalName = "Logical Location Name", 031 description = "Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.", 032 useName = "name" 033 ) 034 private String _name; 035 036 @BoundField( 037 formalName = "Index", 038 description = "The index within the logical locations array.", 039 useName = "index", 040 defaultValue = "-1", 041 typeAdapter = IntegerAdapter.class, 042 valueConstraints = @ValueConstraints(expect = @Expect(level = IConstraint.Level.ERROR, test = "@id >= -1", message = "The index '{ . }' is not greater than or equal to '-1'.")) 043 ) 044 private BigInteger _index; 045 046 @BoundField( 047 formalName = "Fully Qualified Name", 048 description = "The human-readable fully qualified name of the logical location.", 049 useName = "fullyQualifiedName" 050 ) 051 private String _fullyQualifiedName; 052 053 @BoundField( 054 formalName = "Decorated Name", 055 description = "The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.", 056 useName = "decoratedName" 057 ) 058 private String _decoratedName; 059 060 @BoundField( 061 formalName = "Parent Index", 062 description = "Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.", 063 useName = "parentIndex", 064 defaultValue = "-1", 065 typeAdapter = IntegerAdapter.class, 066 valueConstraints = @ValueConstraints(expect = @Expect(level = IConstraint.Level.ERROR, test = "@id >= -1", message = "The index '{ . }' is not greater than or equal to '-1'.")) 067 ) 068 private BigInteger _parentIndex; 069 070 @BoundField( 071 formalName = "Kind", 072 description = "The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct.", 073 useName = "kind" 074 ) 075 private String _kind; 076 077 public LogicalLocation() { 078 this(null); 079 } 080 081 public LogicalLocation(IMetaschemaData data) { 082 this.__metaschemaData = data; 083 } 084 085 @Override 086 public IMetaschemaData getMetaschemaData() { 087 return __metaschemaData; 088 } 089 090 public String getName() { 091 return _name; 092 } 093 094 public void setName(String value) { 095 _name = value; 096 } 097 098 public BigInteger getIndex() { 099 return _index; 100 } 101 102 public void setIndex(BigInteger value) { 103 _index = value; 104 } 105 106 public String getFullyQualifiedName() { 107 return _fullyQualifiedName; 108 } 109 110 public void setFullyQualifiedName(String value) { 111 _fullyQualifiedName = value; 112 } 113 114 public String getDecoratedName() { 115 return _decoratedName; 116 } 117 118 public void setDecoratedName(String value) { 119 _decoratedName = value; 120 } 121 122 public BigInteger getParentIndex() { 123 return _parentIndex; 124 } 125 126 public void setParentIndex(BigInteger value) { 127 _parentIndex = value; 128 } 129 130 public String getKind() { 131 return _kind; 132 } 133 134 public void setKind(String value) { 135 _kind = value; 136 } 137 138 @Override 139 public String toString() { 140 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 141 } 142}