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

Public Member Functions

 FlutterWidgetProperty (String documentation, String expression, int id, boolean isRequired, boolean isSafeToUpdate, String name, List< FlutterWidgetProperty > children, FlutterWidgetPropertyEditor editor, FlutterWidgetPropertyValue value)
 
boolean equals (Object obj)
 
List< FlutterWidgetPropertygetChildren ()
 
String getDocumentation ()
 
FlutterWidgetPropertyEditor getEditor ()
 
String getExpression ()
 
int getId ()
 
boolean isRequired ()
 
boolean isSafeToUpdate ()
 
String getName ()
 
FlutterWidgetPropertyValue getValue ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static FlutterWidgetProperty fromJson (JsonObject jsonObject)
 
static List< FlutterWidgetPropertyfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final FlutterWidgetProperty[] EMPTY_ARRAY = new FlutterWidgetProperty[0]
 
static final List< FlutterWidgetPropertyEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A property of a Flutter widget.

@coverage dart.server.generated.types

Definition at line 32 of file FlutterWidgetProperty.java.

Constructor & Destructor Documentation

◆ FlutterWidgetProperty()

org.dartlang.analysis.server.protocol.FlutterWidgetProperty.FlutterWidgetProperty ( String  documentation,
String  expression,
int  id,
boolean  isRequired,
boolean  isSafeToUpdate,
String  name,
List< FlutterWidgetProperty children,
FlutterWidgetPropertyEditor  editor,
FlutterWidgetPropertyValue  value 
)
inline

Constructor for FlutterWidgetProperty.

Definition at line 94 of file FlutterWidgetProperty.java.

94 {
95 this.documentation = documentation;
96 this.expression = expression;
97 this.id = id;
98 this.isRequired = isRequired;
99 this.isSafeToUpdate = isSafeToUpdate;
100 this.name = name;
101 this.children = children;
102 this.editor = editor;
103 this.value = value;
104 }

Member Function Documentation

◆ equals()

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

Definition at line 107 of file FlutterWidgetProperty.java.

107 {
108 if (obj instanceof FlutterWidgetProperty) {
110 return
111 ObjectUtilities.equals(other.documentation, documentation) &&
112 ObjectUtilities.equals(other.expression, expression) &&
113 other.id == id &&
114 other.isRequired == isRequired &&
115 other.isSafeToUpdate == isSafeToUpdate &&
116 ObjectUtilities.equals(other.name, name) &&
117 ObjectUtilities.equals(other.children, children) &&
118 ObjectUtilities.equals(other.editor, editor) &&
119 ObjectUtilities.equals(other.value, value);
120 }
121 return false;
122 }
FlutterWidgetProperty(String documentation, String expression, int id, boolean isRequired, boolean isSafeToUpdate, String name, List< FlutterWidgetProperty > children, FlutterWidgetPropertyEditor editor, FlutterWidgetPropertyValue value)

◆ fromJson()

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

Definition at line 124 of file FlutterWidgetProperty.java.

124 {
125 String documentation = jsonObject.get("documentation") == null ? null : jsonObject.get("documentation").getAsString();
126 String expression = jsonObject.get("expression") == null ? null : jsonObject.get("expression").getAsString();
127 int id = jsonObject.get("id").getAsInt();
128 boolean isRequired = jsonObject.get("isRequired").getAsBoolean();
129 boolean isSafeToUpdate = jsonObject.get("isSafeToUpdate").getAsBoolean();
130 String name = jsonObject.get("name").getAsString();
131 List<FlutterWidgetProperty> children = jsonObject.get("children") == null ? null : FlutterWidgetProperty.fromJsonArray(jsonObject.get("children").getAsJsonArray());
132 FlutterWidgetPropertyEditor editor = jsonObject.get("editor") == null ? null : FlutterWidgetPropertyEditor.fromJson(jsonObject.get("editor").getAsJsonObject());
133 FlutterWidgetPropertyValue value = jsonObject.get("value") == null ? null : FlutterWidgetPropertyValue.fromJson(jsonObject.get("value").getAsJsonObject());
134 return new FlutterWidgetProperty(documentation, expression, id, isRequired, isSafeToUpdate, name, children, editor, value);
135 }
static FlutterWidgetPropertyEditor fromJson(JsonObject jsonObject)
static FlutterWidgetPropertyValue fromJson(JsonObject jsonObject)

◆ fromJsonArray()

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

Definition at line 137 of file FlutterWidgetProperty.java.

137 {
138 if (jsonArray == null) {
139 return EMPTY_LIST;
140 }
141 ArrayList<FlutterWidgetProperty> list = new ArrayList<FlutterWidgetProperty>(jsonArray.size());
142 Iterator<JsonElement> iterator = jsonArray.iterator();
143 while (iterator.hasNext()) {
144 list.add(fromJson(iterator.next().getAsJsonObject()));
145 }
146 return list;
147 }
static FlutterWidgetProperty fromJson(JsonObject jsonObject)

◆ getChildren()

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

The list of children properties, if any. For example any property of type EdgeInsets will have four children properties of type double - left / top / right / bottom.

Definition at line 153 of file FlutterWidgetProperty.java.

153 {
154 return children;
155 }

◆ getDocumentation()

String org.dartlang.analysis.server.protocol.FlutterWidgetProperty.getDocumentation ( )
inline

The documentation of the property to show to the user. Omitted if the server does not know the documentation, e.g. because the corresponding field is not documented.

Definition at line 161 of file FlutterWidgetProperty.java.

161 {
162 return documentation;
163 }

◆ getEditor()

FlutterWidgetPropertyEditor org.dartlang.analysis.server.protocol.FlutterWidgetProperty.getEditor ( )
inline

The editor that should be used by the client. This field is omitted if the server does not know the editor for this property, for example because it does not have one of the supported types.

Definition at line 169 of file FlutterWidgetProperty.java.

169 {
170 return editor;
171 }

◆ getExpression()

String org.dartlang.analysis.server.protocol.FlutterWidgetProperty.getExpression ( )
inline

If the value of this property is set, the Dart code of the expression of this property.

Definition at line 176 of file FlutterWidgetProperty.java.

176 {
177 return expression;
178 }

◆ getId()

int org.dartlang.analysis.server.protocol.FlutterWidgetProperty.getId ( )
inline

The unique identifier of the property, must be passed back to the server when updating the property value. Identifiers become invalid on any source code change.

Definition at line 184 of file FlutterWidgetProperty.java.

184 {
185 return id;
186 }

◆ getName()

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

The name of the property to display to the user.

Definition at line 209 of file FlutterWidgetProperty.java.

209 {
210 return name;
211 }

◆ getValue()

FlutterWidgetPropertyValue org.dartlang.analysis.server.protocol.FlutterWidgetProperty.getValue ( )
inline

If the expression is set, and the server knows the value of the expression, this field is set.

Definition at line 216 of file FlutterWidgetProperty.java.

216 {
217 return value;
218 }

◆ hashCode()

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

Definition at line 221 of file FlutterWidgetProperty.java.

221 {
222 HashCodeBuilder builder = new HashCodeBuilder();
223 builder.append(documentation);
224 builder.append(expression);
225 builder.append(id);
226 builder.append(isRequired);
227 builder.append(isSafeToUpdate);
228 builder.append(name);
229 builder.append(children);
230 builder.append(editor);
231 builder.append(value);
232 return builder.toHashCode();
233 }

◆ isRequired()

boolean org.dartlang.analysis.server.protocol.FlutterWidgetProperty.isRequired ( )
inline

True if the property is required, e.g. because it corresponds to a required parameter of a constructor.

Definition at line 192 of file FlutterWidgetProperty.java.

192 {
193 return isRequired;
194 }

◆ isSafeToUpdate()

boolean org.dartlang.analysis.server.protocol.FlutterWidgetProperty.isSafeToUpdate ( )
inline

If the property expression is a concrete value (e.g. a literal, or an enum constant), then it is safe to replace the expression with another concrete value. In this case this field is true. Otherwise, for example when the expression is a reference to a field, so that its value is provided from outside, this field is false.

Definition at line 202 of file FlutterWidgetProperty.java.

202 {
203 return isSafeToUpdate;
204 }

◆ toJson()

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

Definition at line 235 of file FlutterWidgetProperty.java.

235 {
236 JsonObject jsonObject = new JsonObject();
237 if (documentation != null) {
238 jsonObject.addProperty("documentation", documentation);
239 }
240 if (expression != null) {
241 jsonObject.addProperty("expression", expression);
242 }
243 jsonObject.addProperty("id", id);
244 jsonObject.addProperty("isRequired", isRequired);
245 jsonObject.addProperty("isSafeToUpdate", isSafeToUpdate);
246 jsonObject.addProperty("name", name);
247 if (children != null) {
248 JsonArray jsonArrayChildren = new JsonArray();
249 for (FlutterWidgetProperty elt : children) {
250 jsonArrayChildren.add(elt.toJson());
251 }
252 jsonObject.add("children", jsonArrayChildren);
253 }
254 if (editor != null) {
255 jsonObject.add("editor", editor.toJson());
256 }
257 if (value != null) {
258 jsonObject.add("value", value.toJson());
259 }
260 return jsonObject;
261 }

◆ toString()

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

Definition at line 264 of file FlutterWidgetProperty.java.

264 {
265 StringBuilder builder = new StringBuilder();
266 builder.append("[");
267 builder.append("documentation=");
268 builder.append(documentation + ", ");
269 builder.append("expression=");
270 builder.append(expression + ", ");
271 builder.append("id=");
272 builder.append(id + ", ");
273 builder.append("isRequired=");
274 builder.append(isRequired + ", ");
275 builder.append("isSafeToUpdate=");
276 builder.append(isSafeToUpdate + ", ");
277 builder.append("name=");
278 builder.append(name + ", ");
279 builder.append("children=");
280 builder.append(StringUtils.join(children, ", ") + ", ");
281 builder.append("editor=");
282 builder.append(editor + ", ");
283 builder.append("value=");
284 builder.append(value);
285 builder.append("]");
286 return builder.toString();
287 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 34 of file FlutterWidgetProperty.java.

◆ EMPTY_LIST

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

Definition at line 36 of file FlutterWidgetProperty.java.


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