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

Public Member Functions

 Element (String kind, String name, Location location, int flags, String parameters, String returnType, String typeParameters, String aliasedType)
 
boolean equals (Object obj)
 
String getAliasedType ()
 
int getFlags ()
 
String getKind ()
 
Location getLocation ()
 
String getName ()
 
String getParameters ()
 
String getReturnType ()
 
String getTypeParameters ()
 
int hashCode ()
 
boolean isAbstract ()
 
boolean isConst ()
 
boolean isDeprecated ()
 
boolean isFinal ()
 
boolean isPrivate ()
 
boolean isTopLevelOrStatic ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static Element fromJson (JsonObject jsonObject)
 
static List< ElementfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final Element[] EMPTY_ARRAY = new Element[0]
 
static final List< ElementEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

Information about an element (something that can be declared in code).

@coverage dart.server.generated.types

Definition at line 32 of file Element.java.

Constructor & Destructor Documentation

◆ Element()

org.dartlang.analysis.server.protocol.Element.Element ( String  kind,
String  name,
Location  location,
int  flags,
String  parameters,
String  returnType,
String  typeParameters,
String  aliasedType 
)
inline

Constructor for Element.

Definition at line 106 of file Element.java.

106 {
107 this.kind = kind;
108 this.name = name;
109 this.location = location;
110 this.flags = flags;
111 this.parameters = parameters;
112 this.returnType = returnType;
113 this.typeParameters = typeParameters;
114 this.aliasedType = aliasedType;
115 }

Member Function Documentation

◆ equals()

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

Definition at line 118 of file Element.java.

118 {
119 if (obj instanceof Element) {
120 Element other = (Element) obj;
121 return
122 ObjectUtilities.equals(other.kind, kind) &&
123 ObjectUtilities.equals(other.name, name) &&
124 ObjectUtilities.equals(other.location, location) &&
125 other.flags == flags &&
126 ObjectUtilities.equals(other.parameters, parameters) &&
127 ObjectUtilities.equals(other.returnType, returnType) &&
128 ObjectUtilities.equals(other.typeParameters, typeParameters) &&
129 ObjectUtilities.equals(other.aliasedType, aliasedType);
130 }
131 return false;
132 }
Element(String kind, String name, Location location, int flags, String parameters, String returnType, String typeParameters, String aliasedType)
Definition: Element.java:106
Definition: dart.idl:42

◆ fromJson()

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

Definition at line 134 of file Element.java.

134 {
135 String kind = jsonObject.get("kind").getAsString();
136 String name = jsonObject.get("name").getAsString();
137 Location location = jsonObject.get("location") == null ? null : Location.fromJson(jsonObject.get("location").getAsJsonObject());
138 int flags = jsonObject.get("flags").getAsInt();
139 String parameters = jsonObject.get("parameters") == null ? null : jsonObject.get("parameters").getAsString();
140 String returnType = jsonObject.get("returnType") == null ? null : jsonObject.get("returnType").getAsString();
141 String typeParameters = jsonObject.get("typeParameters") == null ? null : jsonObject.get("typeParameters").getAsString();
142 String aliasedType = jsonObject.get("aliasedType") == null ? null : jsonObject.get("aliasedType").getAsString();
143 return new Element(kind, name, location, flags, parameters, returnType, typeParameters, aliasedType);
144 }
static Location fromJson(JsonObject jsonObject)
Definition: Location.java:102

◆ fromJsonArray()

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

Definition at line 146 of file Element.java.

146 {
147 if (jsonArray == null) {
148 return EMPTY_LIST;
149 }
150 ArrayList<Element> list = new ArrayList<Element>(jsonArray.size());
151 Iterator<JsonElement> iterator = jsonArray.iterator();
152 while (iterator.hasNext()) {
153 list.add(fromJson(iterator.next().getAsJsonObject()));
154 }
155 return list;
156 }
static final List< Element > EMPTY_LIST
Definition: Element.java:36
static Element fromJson(JsonObject jsonObject)
Definition: Element.java:134

◆ getAliasedType()

String org.dartlang.analysis.server.protocol.Element.getAliasedType ( )
inline

If the element is a type alias, this field is the aliased type. Otherwise this field will not be defined.

Definition at line 162 of file Element.java.

162 {
163 return aliasedType;
164 }

◆ getFlags()

int org.dartlang.analysis.server.protocol.Element.getFlags ( )
inline

A bit-map containing the following flags:

  • 0x01 - set if the element is explicitly or implicitly abstract
  • 0x02 - set if the element was declared to be 'const'
  • 0x04 - set if the element was declared to be 'final'
  • 0x08 - set if the element is a static member of a class or is a top-level function or field
  • 0x10 - set if the element is private
  • 0x20 - set if the element is deprecated

Definition at line 176 of file Element.java.

176 {
177 return flags;
178 }

◆ getKind()

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

The kind of the element.

Definition at line 183 of file Element.java.

183 {
184 return kind;
185 }

◆ getLocation()

Location org.dartlang.analysis.server.protocol.Element.getLocation ( )
inline

The location of the name in the declaration of the element.

Definition at line 190 of file Element.java.

190 {
191 return location;
192 }

◆ getName()

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

The name of the element. This is typically used as the label in the outline.

Definition at line 197 of file Element.java.

197 {
198 return name;
199 }

◆ getParameters()

String org.dartlang.analysis.server.protocol.Element.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 "()".

Definition at line 206 of file Element.java.

206 {
207 return parameters;
208 }

◆ getReturnType()

String org.dartlang.analysis.server.protocol.Element.getReturnType ( )
inline

The return type of the element. If the element is not a method or function this field will not be defined. If the element does not have a declared return type, this field will contain an empty string.

Definition at line 215 of file Element.java.

215 {
216 return returnType;
217 }

◆ getTypeParameters()

String org.dartlang.analysis.server.protocol.Element.getTypeParameters ( )
inline

The type parameter list for the element. If the element doesn't have type parameters, this field will not be defined.

Definition at line 223 of file Element.java.

223 {
224 return typeParameters;
225 }

◆ hashCode()

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

Definition at line 228 of file Element.java.

228 {
229 HashCodeBuilder builder = new HashCodeBuilder();
230 builder.append(kind);
231 builder.append(name);
232 builder.append(location);
233 builder.append(flags);
234 builder.append(parameters);
235 builder.append(returnType);
236 builder.append(typeParameters);
237 builder.append(aliasedType);
238 return builder.toHashCode();
239 }

◆ isAbstract()

boolean org.dartlang.analysis.server.protocol.Element.isAbstract ( )
inline

Definition at line 241 of file Element.java.

241 {
242 return (flags & ABSTRACT) != 0;
243 }

◆ isConst()

boolean org.dartlang.analysis.server.protocol.Element.isConst ( )
inline

Definition at line 245 of file Element.java.

245 {
246 return (flags & CONST) != 0;
247 }

◆ isDeprecated()

boolean org.dartlang.analysis.server.protocol.Element.isDeprecated ( )
inline

Definition at line 249 of file Element.java.

249 {
250 return (flags & DEPRECATED) != 0;
251 }

◆ isFinal()

boolean org.dartlang.analysis.server.protocol.Element.isFinal ( )
inline

Definition at line 253 of file Element.java.

253 {
254 return (flags & FINAL) != 0;
255 }

◆ isPrivate()

boolean org.dartlang.analysis.server.protocol.Element.isPrivate ( )
inline

Definition at line 257 of file Element.java.

257 {
258 return (flags & PRIVATE) != 0;
259 }

◆ isTopLevelOrStatic()

boolean org.dartlang.analysis.server.protocol.Element.isTopLevelOrStatic ( )
inline

Definition at line 261 of file Element.java.

261 {
262 return (flags & TOP_LEVEL_STATIC) != 0;
263 }

◆ toJson()

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

Definition at line 265 of file Element.java.

265 {
266 JsonObject jsonObject = new JsonObject();
267 jsonObject.addProperty("kind", kind);
268 jsonObject.addProperty("name", name);
269 if (location != null) {
270 jsonObject.add("location", location.toJson());
271 }
272 jsonObject.addProperty("flags", flags);
273 if (parameters != null) {
274 jsonObject.addProperty("parameters", parameters);
275 }
276 if (returnType != null) {
277 jsonObject.addProperty("returnType", returnType);
278 }
279 if (typeParameters != null) {
280 jsonObject.addProperty("typeParameters", typeParameters);
281 }
282 if (aliasedType != null) {
283 jsonObject.addProperty("aliasedType", aliasedType);
284 }
285 return jsonObject;
286 }

◆ toString()

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

Definition at line 289 of file Element.java.

289 {
290 StringBuilder builder = new StringBuilder();
291 builder.append("[");
292 builder.append("kind=");
293 builder.append(kind + ", ");
294 builder.append("name=");
295 builder.append(name + ", ");
296 builder.append("location=");
297 builder.append(location + ", ");
298 builder.append("flags=");
299 builder.append(flags + ", ");
300 builder.append("parameters=");
301 builder.append(parameters + ", ");
302 builder.append("returnType=");
303 builder.append(returnType + ", ");
304 builder.append("typeParameters=");
305 builder.append(typeParameters + ", ");
306 builder.append("aliasedType=");
307 builder.append(aliasedType);
308 builder.append("]");
309 return builder.toString();
310 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 34 of file Element.java.

◆ EMPTY_LIST

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

Definition at line 36 of file Element.java.


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