Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
org.dartlang.analysis.server.protocol.FlutterOutline Class Reference

Public Member Functions

 FlutterOutline (String kind, int offset, int length, int codeOffset, int codeLength, String label, Element dartElement, List< FlutterOutlineAttribute > attributes, String className, String parentAssociationLabel, String variableName, List< FlutterOutline > children)
 
boolean equals (Object obj)
 
List< FlutterOutlineAttributegetAttributes ()
 
List< FlutterOutlinegetChildren ()
 
String getClassName ()
 
int getCodeLength ()
 
int getCodeOffset ()
 
Element getDartElement ()
 
String getKind ()
 
String getLabel ()
 
int getLength ()
 
int getOffset ()
 
String getParentAssociationLabel ()
 
String getVariableName ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static FlutterOutline fromJson (JsonObject jsonObject)
 
static List< FlutterOutlinefromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final FlutterOutline[] EMPTY_ARRAY = new FlutterOutline[0]
 
static final List< FlutterOutlineEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

An node in the Flutter specific outline structure of a file.

@coverage dart.server.generated.types

Definition at line 32 of file FlutterOutline.java.

Constructor & Destructor Documentation

◆ FlutterOutline()

org.dartlang.analysis.server.protocol.FlutterOutline.FlutterOutline ( String  kind,
int  offset,
int  length,
int  codeOffset,
int  codeLength,
String  label,
Element  dartElement,
List< FlutterOutlineAttribute attributes,
String  className,
String  parentAssociationLabel,
String  variableName,
List< FlutterOutline children 
)
inline

Constructor for FlutterOutline.

Definition at line 109 of file FlutterOutline.java.

109 {
110 this.kind = kind;
111 this.offset = offset;
112 this.length = length;
113 this.codeOffset = codeOffset;
114 this.codeLength = codeLength;
115 this.label = label;
116 this.dartElement = dartElement;
117 this.attributes = attributes;
118 this.className = className;
119 this.parentAssociationLabel = parentAssociationLabel;
120 this.variableName = variableName;
121 this.children = children;
122 }

Member Function Documentation

◆ equals()

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

Definition at line 125 of file FlutterOutline.java.

125 {
126 if (obj instanceof FlutterOutline) {
127 FlutterOutline other = (FlutterOutline) obj;
128 return
129 ObjectUtilities.equals(other.kind, kind) &&
130 other.offset == offset &&
131 other.length == length &&
132 other.codeOffset == codeOffset &&
133 other.codeLength == codeLength &&
134 ObjectUtilities.equals(other.label, label) &&
135 ObjectUtilities.equals(other.dartElement, dartElement) &&
136 ObjectUtilities.equals(other.attributes, attributes) &&
137 ObjectUtilities.equals(other.className, className) &&
138 ObjectUtilities.equals(other.parentAssociationLabel, parentAssociationLabel) &&
139 ObjectUtilities.equals(other.variableName, variableName) &&
140 ObjectUtilities.equals(other.children, children);
141 }
142 return false;
143 }

◆ fromJson()

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

Definition at line 145 of file FlutterOutline.java.

145 {
146 String kind = jsonObject.get("kind").getAsString();
147 int offset = jsonObject.get("offset").getAsInt();
148 int length = jsonObject.get("length").getAsInt();
149 int codeOffset = jsonObject.get("codeOffset").getAsInt();
150 int codeLength = jsonObject.get("codeLength").getAsInt();
151 String label = jsonObject.get("label") == null ? null : jsonObject.get("label").getAsString();
152 Element dartElement = jsonObject.get("dartElement") == null ? null : Element.fromJson(jsonObject.get("dartElement").getAsJsonObject());
153 List<FlutterOutlineAttribute> attributes = jsonObject.get("attributes") == null ? null : FlutterOutlineAttribute.fromJsonArray(jsonObject.get("attributes").getAsJsonArray());
154 String className = jsonObject.get("className") == null ? null : jsonObject.get("className").getAsString();
155 String parentAssociationLabel = jsonObject.get("parentAssociationLabel") == null ? null : jsonObject.get("parentAssociationLabel").getAsString();
156 String variableName = jsonObject.get("variableName") == null ? null : jsonObject.get("variableName").getAsString();
157 List<FlutterOutline> children = jsonObject.get("children") == null ? null : FlutterOutline.fromJsonArray(jsonObject.get("children").getAsJsonArray());
158 return new FlutterOutline(kind, offset, length, codeOffset, codeLength, label, dartElement, attributes, className, parentAssociationLabel, variableName, children);
159 }
FlutterOutline(String kind, int offset, int length, int codeOffset, int codeLength, String label, Element dartElement, List< FlutterOutlineAttribute > attributes, String className, String parentAssociationLabel, String variableName, List< FlutterOutline > children)

◆ fromJsonArray()

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

Definition at line 161 of file FlutterOutline.java.

161 {
162 if (jsonArray == null) {
163 return EMPTY_LIST;
164 }
165 ArrayList<FlutterOutline> list = new ArrayList<FlutterOutline>(jsonArray.size());
166 Iterator<JsonElement> iterator = jsonArray.iterator();
167 while (iterator.hasNext()) {
168 list.add(fromJson(iterator.next().getAsJsonObject()));
169 }
170 return list;
171 }
static FlutterOutline fromJson(JsonObject jsonObject)
static final List< FlutterOutline > EMPTY_LIST

◆ getAttributes()

List< FlutterOutlineAttribute > org.dartlang.analysis.server.protocol.FlutterOutline.getAttributes ( )
inline

Additional attributes for this node, which might be interesting to display on the client. These attributes are usually arguments for the instance creation or the invocation that created the widget.

Definition at line 178 of file FlutterOutline.java.

178 {
179 return attributes;
180 }

◆ getChildren()

List< FlutterOutline > org.dartlang.analysis.server.protocol.FlutterOutline.getChildren ( )
inline

The children of the node. The field will be omitted if the node has no children.

Definition at line 185 of file FlutterOutline.java.

185 {
186 return children;
187 }

◆ getClassName()

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

If the node creates a new class instance, or a reference to an instance, this field has the name of the class.

Definition at line 193 of file FlutterOutline.java.

193 {
194 return className;
195 }

◆ getCodeLength()

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

The length of the element code.

Definition at line 200 of file FlutterOutline.java.

200 {
201 return codeLength;
202 }

◆ getCodeOffset()

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

The offset of the first character of the element code, which is neither documentation, nor annotation.

Definition at line 208 of file FlutterOutline.java.

208 {
209 return codeOffset;
210 }

◆ getDartElement()

Element org.dartlang.analysis.server.protocol.FlutterOutline.getDartElement ( )
inline

If this node is a Dart element, the description of it; omitted otherwise.

Definition at line 215 of file FlutterOutline.java.

215 {
216 return dartElement;
217 }

◆ getKind()

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

The kind of the node.

Definition at line 222 of file FlutterOutline.java.

222 {
223 return kind;
224 }

◆ getLabel()

String org.dartlang.analysis.server.protocol.FlutterOutline.getLabel ( )
inline

The text label of the node children of the node. It is provided for any FlutterOutlineKind.GENERIC node, where better information is not available.

Definition at line 230 of file FlutterOutline.java.

230 {
231 return label;
232 }

◆ getLength()

int org.dartlang.analysis.server.protocol.FlutterOutline.getLength ( )
inline

The length of the element.

Definition at line 237 of file FlutterOutline.java.

237 {
238 return length;
239 }

◆ getOffset()

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

The offset of the first character of the element. This is different than the offset in the Element, which is the offset of the name of the element. It can be used, for example, to map locations in the file back to an outline.

Definition at line 246 of file FlutterOutline.java.

246 {
247 return offset;
248 }

◆ getParentAssociationLabel()

String org.dartlang.analysis.server.protocol.FlutterOutline.getParentAssociationLabel ( )
inline

A short text description how this node is associated with the parent node. For example "appBar" or "body" in Scaffold.

Definition at line 254 of file FlutterOutline.java.

254 {
255 return parentAssociationLabel;
256 }

◆ getVariableName()

String org.dartlang.analysis.server.protocol.FlutterOutline.getVariableName ( )
inline

If FlutterOutlineKind.VARIABLE, the name of the variable.

Definition at line 261 of file FlutterOutline.java.

261 {
262 return variableName;
263 }

◆ hashCode()

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

Definition at line 266 of file FlutterOutline.java.

266 {
267 HashCodeBuilder builder = new HashCodeBuilder();
268 builder.append(kind);
269 builder.append(offset);
270 builder.append(length);
271 builder.append(codeOffset);
272 builder.append(codeLength);
273 builder.append(label);
274 builder.append(dartElement);
275 builder.append(attributes);
276 builder.append(className);
277 builder.append(parentAssociationLabel);
278 builder.append(variableName);
279 builder.append(children);
280 return builder.toHashCode();
281 }

◆ toJson()

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

Definition at line 283 of file FlutterOutline.java.

283 {
284 JsonObject jsonObject = new JsonObject();
285 jsonObject.addProperty("kind", kind);
286 jsonObject.addProperty("offset", offset);
287 jsonObject.addProperty("length", length);
288 jsonObject.addProperty("codeOffset", codeOffset);
289 jsonObject.addProperty("codeLength", codeLength);
290 if (label != null) {
291 jsonObject.addProperty("label", label);
292 }
293 if (dartElement != null) {
294 jsonObject.add("dartElement", dartElement.toJson());
295 }
296 if (attributes != null) {
297 JsonArray jsonArrayAttributes = new JsonArray();
298 for (FlutterOutlineAttribute elt : attributes) {
299 jsonArrayAttributes.add(elt.toJson());
300 }
301 jsonObject.add("attributes", jsonArrayAttributes);
302 }
303 if (className != null) {
304 jsonObject.addProperty("className", className);
305 }
306 if (parentAssociationLabel != null) {
307 jsonObject.addProperty("parentAssociationLabel", parentAssociationLabel);
308 }
309 if (variableName != null) {
310 jsonObject.addProperty("variableName", variableName);
311 }
312 if (children != null) {
313 JsonArray jsonArrayChildren = new JsonArray();
314 for (FlutterOutline elt : children) {
315 jsonArrayChildren.add(elt.toJson());
316 }
317 jsonObject.add("children", jsonArrayChildren);
318 }
319 return jsonObject;
320 }

◆ toString()

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

Definition at line 323 of file FlutterOutline.java.

323 {
324 StringBuilder builder = new StringBuilder();
325 builder.append("[");
326 builder.append("kind=");
327 builder.append(kind + ", ");
328 builder.append("offset=");
329 builder.append(offset + ", ");
330 builder.append("length=");
331 builder.append(length + ", ");
332 builder.append("codeOffset=");
333 builder.append(codeOffset + ", ");
334 builder.append("codeLength=");
335 builder.append(codeLength + ", ");
336 builder.append("label=");
337 builder.append(label + ", ");
338 builder.append("dartElement=");
339 builder.append(dartElement + ", ");
340 builder.append("attributes=");
341 builder.append(StringUtils.join(attributes, ", ") + ", ");
342 builder.append("className=");
343 builder.append(className + ", ");
344 builder.append("parentAssociationLabel=");
345 builder.append(parentAssociationLabel + ", ");
346 builder.append("variableName=");
347 builder.append(variableName + ", ");
348 builder.append("children=");
349 builder.append(StringUtils.join(children, ", "));
350 builder.append("]");
351 return builder.toString();
352 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 34 of file FlutterOutline.java.

◆ EMPTY_LIST

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

Definition at line 36 of file FlutterOutline.java.


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