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.ImportedElements Class Reference

Public Member Functions

 ImportedElements (String path, String prefix, List< String > elements)
 
boolean equals (Object obj)
 
List< String > getElements ()
 
String getPath ()
 
String getPrefix ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static ImportedElements fromJson (JsonObject jsonObject)
 
static List< ImportedElementsfromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final ImportedElements[] EMPTY_ARRAY = new ImportedElements[0]
 
static final List< ImportedElementsEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A description of the elements that are referenced in a region of a file that come from a single imported library.

@coverage dart.server.generated.types

Definition at line 33 of file ImportedElements.java.

Constructor & Destructor Documentation

◆ ImportedElements()

org.dartlang.analysis.server.protocol.ImportedElements.ImportedElements ( String  path,
String  prefix,
List< String >  elements 
)
inline

Constructor for ImportedElements.

Definition at line 57 of file ImportedElements.java.

57 {
58 this.path = path;
59 this.prefix = prefix;
60 this.elements = elements;
61 }

Member Function Documentation

◆ equals()

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

Definition at line 64 of file ImportedElements.java.

64 {
65 if (obj instanceof ImportedElements) {
66 ImportedElements other = (ImportedElements) obj;
67 return
68 ObjectUtilities.equals(other.path, path) &&
69 ObjectUtilities.equals(other.prefix, prefix) &&
70 ObjectUtilities.equals(other.elements, elements);
71 }
72 return false;
73 }

◆ fromJson()

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

Definition at line 75 of file ImportedElements.java.

75 {
76 String path = jsonObject.get("path").getAsString();
77 String prefix = jsonObject.get("prefix").getAsString();
78 List<String> elements = JsonUtilities.decodeStringList(jsonObject.get("elements").getAsJsonArray());
79 return new ImportedElements(path, prefix, elements);
80 }
ImportedElements(String path, String prefix, List< String > elements)

◆ fromJsonArray()

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

Definition at line 82 of file ImportedElements.java.

82 {
83 if (jsonArray == null) {
84 return EMPTY_LIST;
85 }
86 ArrayList<ImportedElements> list = new ArrayList<ImportedElements>(jsonArray.size());
87 Iterator<JsonElement> iterator = jsonArray.iterator();
88 while (iterator.hasNext()) {
89 list.add(fromJson(iterator.next().getAsJsonObject()));
90 }
91 return list;
92 }
static ImportedElements fromJson(JsonObject jsonObject)

◆ getElements()

List< String > org.dartlang.analysis.server.protocol.ImportedElements.getElements ( )
inline

The names of the elements imported from the library.

Definition at line 97 of file ImportedElements.java.

97 {
98 return elements;
99 }

◆ getPath()

String org.dartlang.analysis.server.protocol.ImportedElements.getPath ( )
inline

The absolute and normalized path of the file containing the library.

Definition at line 104 of file ImportedElements.java.

104 {
105 return path;
106 }

◆ getPrefix()

String org.dartlang.analysis.server.protocol.ImportedElements.getPrefix ( )
inline

The prefix that was used when importing the library into the original source.

Definition at line 111 of file ImportedElements.java.

111 {
112 return prefix;
113 }

◆ hashCode()

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

Definition at line 116 of file ImportedElements.java.

116 {
117 HashCodeBuilder builder = new HashCodeBuilder();
118 builder.append(path);
119 builder.append(prefix);
120 builder.append(elements);
121 return builder.toHashCode();
122 }

◆ toJson()

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

Definition at line 124 of file ImportedElements.java.

124 {
125 JsonObject jsonObject = new JsonObject();
126 jsonObject.addProperty("path", path);
127 jsonObject.addProperty("prefix", prefix);
128 JsonArray jsonArrayElements = new JsonArray();
129 for (String elt : elements) {
130 jsonArrayElements.add(new JsonPrimitive(elt));
131 }
132 jsonObject.add("elements", jsonArrayElements);
133 return jsonObject;
134 }

◆ toString()

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

Definition at line 137 of file ImportedElements.java.

137 {
138 StringBuilder builder = new StringBuilder();
139 builder.append("[");
140 builder.append("path=");
141 builder.append(path + ", ");
142 builder.append("prefix=");
143 builder.append(prefix + ", ");
144 builder.append("elements=");
145 builder.append(StringUtils.join(elements, ", "));
146 builder.append("]");
147 return builder.toString();
148 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 35 of file ImportedElements.java.

◆ EMPTY_LIST

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

Definition at line 37 of file ImportedElements.java.


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