Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
org.dartlang.analysis.server.protocol.ElementDeclaration Class Reference

Public Member Functions

 ElementDeclaration (String name, String kind, int fileIndex, int offset, int line, int column, int codeOffset, int codeLength, String className, String mixinName, String parameters)
 
boolean equals (Object obj)
 
String getClassName ()
 
int getCodeLength ()
 
int getCodeOffset ()
 
int getColumn ()
 
int getFileIndex ()
 
String getKind ()
 
int getLine ()
 
String getMixinName ()
 
String getName ()
 
int getOffset ()
 
String getParameters ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static ElementDeclaration fromJson (JsonObject jsonObject)
 
static List< ElementDeclarationfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final ElementDeclaration[] EMPTY_ARRAY = new ElementDeclaration[0]
 
static final List< ElementDeclarationEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A declaration - top-level (class, field, etc) or a class member (method, field, etc).

@coverage dart.server.generated.types

Definition at line 32 of file ElementDeclaration.java.

Constructor & Destructor Documentation

◆ ElementDeclaration()

org.dartlang.analysis.server.protocol.ElementDeclaration.ElementDeclaration ( String  name,
String  kind,
int  fileIndex,
int  offset,
int  line,
int  column,
int  codeOffset,
int  codeLength,
String  className,
String  mixinName,
String  parameters 
)
inline

Constructor for ElementDeclaration.

Definition at line 102 of file ElementDeclaration.java.

102 {
103 this.name = name;
104 this.kind = kind;
105 this.fileIndex = fileIndex;
106 this.offset = offset;
107 this.line = line;
108 this.column = column;
109 this.codeOffset = codeOffset;
110 this.codeLength = codeLength;
111 this.className = className;
112 this.mixinName = mixinName;
113 this.parameters = parameters;
114 }

Member Function Documentation

◆ equals()

boolean org.dartlang.analysis.server.protocol.ElementDeclaration.equals ( Object  obj)
inline

Definition at line 117 of file ElementDeclaration.java.

117 {
118 if (obj instanceof ElementDeclaration) {
120 return
121 ObjectUtilities.equals(other.name, name) &&
122 ObjectUtilities.equals(other.kind, kind) &&
123 other.fileIndex == fileIndex &&
124 other.offset == offset &&
125 other.line == line &&
126 other.column == column &&
127 other.codeOffset == codeOffset &&
128 other.codeLength == codeLength &&
129 ObjectUtilities.equals(other.className, className) &&
130 ObjectUtilities.equals(other.mixinName, mixinName) &&
131 ObjectUtilities.equals(other.parameters, parameters);
132 }
133 return false;
134 }
ElementDeclaration(String name, String kind, int fileIndex, int offset, int line, int column, int codeOffset, int codeLength, String className, String mixinName, String parameters)

◆ fromJson()

static ElementDeclaration org.dartlang.analysis.server.protocol.ElementDeclaration.fromJson ( JsonObject  jsonObject)
inlinestatic

Definition at line 136 of file ElementDeclaration.java.

136 {
137 String name = jsonObject.get("name").getAsString();
138 String kind = jsonObject.get("kind").getAsString();
139 int fileIndex = jsonObject.get("fileIndex").getAsInt();
140 int offset = jsonObject.get("offset").getAsInt();
141 int line = jsonObject.get("line").getAsInt();
142 int column = jsonObject.get("column").getAsInt();
143 int codeOffset = jsonObject.get("codeOffset").getAsInt();
144 int codeLength = jsonObject.get("codeLength").getAsInt();
145 String className = jsonObject.get("className") == null ? null : jsonObject.get("className").getAsString();
146 String mixinName = jsonObject.get("mixinName") == null ? null : jsonObject.get("mixinName").getAsString();
147 String parameters = jsonObject.get("parameters") == null ? null : jsonObject.get("parameters").getAsString();
148 return new ElementDeclaration(name, kind, fileIndex, offset, line, column, codeOffset, codeLength, className, mixinName, parameters);
149 }

◆ fromJsonArray()

static List< ElementDeclaration > org.dartlang.analysis.server.protocol.ElementDeclaration.fromJsonArray ( JsonArray  jsonArray)
inlinestatic

Definition at line 151 of file ElementDeclaration.java.

151 {
152 if (jsonArray == null) {
153 return EMPTY_LIST;
154 }
155 ArrayList<ElementDeclaration> list = new ArrayList<ElementDeclaration>(jsonArray.size());
156 Iterator<JsonElement> iterator = jsonArray.iterator();
157 while (iterator.hasNext()) {
158 list.add(fromJson(iterator.next().getAsJsonObject()));
159 }
160 return list;
161 }
static final List< ElementDeclaration > EMPTY_LIST
static ElementDeclaration fromJson(JsonObject jsonObject)

◆ getClassName()

String org.dartlang.analysis.server.protocol.ElementDeclaration.getClassName ( )
inline

The name of the class enclosing this declaration. If the declaration is not a class member, this field will be absent.

Definition at line 167 of file ElementDeclaration.java.

167 {
168 return className;
169 }

◆ getCodeLength()

int org.dartlang.analysis.server.protocol.ElementDeclaration.getCodeLength ( )
inline

The length of the declaration code in the file.

Definition at line 174 of file ElementDeclaration.java.

174 {
175 return codeLength;
176 }

◆ getCodeOffset()

int org.dartlang.analysis.server.protocol.ElementDeclaration.getCodeOffset ( )
inline

The offset of the first character of the declaration code in the file.

Definition at line 181 of file ElementDeclaration.java.

181 {
182 return codeOffset;
183 }

◆ getColumn()

int org.dartlang.analysis.server.protocol.ElementDeclaration.getColumn ( )
inline

The one-based index of the column containing the declaration name.

Definition at line 188 of file ElementDeclaration.java.

188 {
189 return column;
190 }

◆ getFileIndex()

int org.dartlang.analysis.server.protocol.ElementDeclaration.getFileIndex ( )
inline

The index of the file (in the enclosing response).

Definition at line 195 of file ElementDeclaration.java.

195 {
196 return fileIndex;
197 }

◆ getKind()

String org.dartlang.analysis.server.protocol.ElementDeclaration.getKind ( )
inline

The kind of the element that corresponds to the declaration.

Definition at line 202 of file ElementDeclaration.java.

202 {
203 return kind;
204 }

◆ getLine()

int org.dartlang.analysis.server.protocol.ElementDeclaration.getLine ( )
inline

The one-based index of the line containing the declaration name.

Definition at line 209 of file ElementDeclaration.java.

209 {
210 return line;
211 }

◆ getMixinName()

String org.dartlang.analysis.server.protocol.ElementDeclaration.getMixinName ( )
inline

The name of the mixin enclosing this declaration. If the declaration is not a mixin member, this field will be absent.

Definition at line 217 of file ElementDeclaration.java.

217 {
218 return mixinName;
219 }

◆ getName()

String org.dartlang.analysis.server.protocol.ElementDeclaration.getName ( )
inline

The name of the declaration.

Definition at line 224 of file ElementDeclaration.java.

224 {
225 return name;
226 }

◆ getOffset()

int org.dartlang.analysis.server.protocol.ElementDeclaration.getOffset ( )
inline

The offset of the declaration name in the file.

Definition at line 231 of file ElementDeclaration.java.

231 {
232 return offset;
233 }

◆ getParameters()

String org.dartlang.analysis.server.protocol.ElementDeclaration.getParameters ( )
inline

The parameter list for the element. If the element is not a method or function this field will not be defined. If the element doesn't have parameters (e.g. getter), this field will not be defined. If the element has zero parameters, this field will have a value of "()". The value should not be treated as exact presentation of parameters, it is just approximation of parameters to give the user general idea.

Definition at line 242 of file ElementDeclaration.java.

242 {
243 return parameters;
244 }

◆ hashCode()

int org.dartlang.analysis.server.protocol.ElementDeclaration.hashCode ( )
inline

Definition at line 247 of file ElementDeclaration.java.

247 {
248 HashCodeBuilder builder = new HashCodeBuilder();
249 builder.append(name);
250 builder.append(kind);
251 builder.append(fileIndex);
252 builder.append(offset);
253 builder.append(line);
254 builder.append(column);
255 builder.append(codeOffset);
256 builder.append(codeLength);
257 builder.append(className);
258 builder.append(mixinName);
259 builder.append(parameters);
260 return builder.toHashCode();
261 }

◆ toJson()

JsonObject org.dartlang.analysis.server.protocol.ElementDeclaration.toJson ( )
inline

Definition at line 263 of file ElementDeclaration.java.

263 {
264 JsonObject jsonObject = new JsonObject();
265 jsonObject.addProperty("name", name);
266 jsonObject.addProperty("kind", kind);
267 jsonObject.addProperty("fileIndex", fileIndex);
268 jsonObject.addProperty("offset", offset);
269 jsonObject.addProperty("line", line);
270 jsonObject.addProperty("column", column);
271 jsonObject.addProperty("codeOffset", codeOffset);
272 jsonObject.addProperty("codeLength", codeLength);
273 if (className != null) {
274 jsonObject.addProperty("className", className);
275 }
276 if (mixinName != null) {
277 jsonObject.addProperty("mixinName", mixinName);
278 }
279 if (parameters != null) {
280 jsonObject.addProperty("parameters", parameters);
281 }
282 return jsonObject;
283 }

◆ toString()

String org.dartlang.analysis.server.protocol.ElementDeclaration.toString ( )
inline

Definition at line 286 of file ElementDeclaration.java.

286 {
287 StringBuilder builder = new StringBuilder();
288 builder.append("[");
289 builder.append("name=");
290 builder.append(name + ", ");
291 builder.append("kind=");
292 builder.append(kind + ", ");
293 builder.append("fileIndex=");
294 builder.append(fileIndex + ", ");
295 builder.append("offset=");
296 builder.append(offset + ", ");
297 builder.append("line=");
298 builder.append(line + ", ");
299 builder.append("column=");
300 builder.append(column + ", ");
301 builder.append("codeOffset=");
302 builder.append(codeOffset + ", ");
303 builder.append("codeLength=");
304 builder.append(codeLength + ", ");
305 builder.append("className=");
306 builder.append(className + ", ");
307 builder.append("mixinName=");
308 builder.append(mixinName + ", ");
309 builder.append("parameters=");
310 builder.append(parameters);
311 builder.append("]");
312 return builder.toString();
313 }

Member Data Documentation

◆ EMPTY_ARRAY

final ElementDeclaration [] org.dartlang.analysis.server.protocol.ElementDeclaration.EMPTY_ARRAY = new ElementDeclaration[0]
static

Definition at line 34 of file ElementDeclaration.java.

◆ EMPTY_LIST

final List<ElementDeclaration> org.dartlang.analysis.server.protocol.ElementDeclaration.EMPTY_LIST = Lists.newArrayList()
static

Definition at line 36 of file ElementDeclaration.java.


The documentation for this class was generated from the following file: