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

Public Member Functions

 DiagnosticMessage (String message, Location location)
 
boolean equals (Object obj)
 
Location getLocation ()
 
String getMessage ()
 
int hashCode ()
 
JsonObject toJson ()
 
String toString ()
 

Static Public Member Functions

static DiagnosticMessage fromJson (JsonObject jsonObject)
 
static List< DiagnosticMessagefromJsonArray (JsonArray jsonArray)
 

Static Public Attributes

static final DiagnosticMessage[] EMPTY_ARRAY = new DiagnosticMessage[0]
 
static final List< DiagnosticMessageEMPTY_LIST = Lists.newArrayList()
 

Detailed Description

A message associated with a diagnostic.

For example, if the diagnostic is reporting that a variable has been referenced before it was declared, it might have a diagnostic message that indicates where the variable is declared.

@coverage dart.server.generated.types

Definition at line 35 of file DiagnosticMessage.java.

Constructor & Destructor Documentation

◆ DiagnosticMessage()

org.dartlang.analysis.server.protocol.DiagnosticMessage.DiagnosticMessage ( String  message,
Location  location 
)
inline

Constructor for DiagnosticMessage.

Definition at line 55 of file DiagnosticMessage.java.

55 {
56 this.message = message;
57 this.location = location;
58 }

Member Function Documentation

◆ equals()

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

Definition at line 61 of file DiagnosticMessage.java.

61 {
62 if (obj instanceof DiagnosticMessage) {
63 DiagnosticMessage other = (DiagnosticMessage) obj;
64 return
65 ObjectUtilities.equals(other.message, message) &&
66 ObjectUtilities.equals(other.location, location);
67 }
68 return false;
69 }

◆ fromJson()

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

Definition at line 71 of file DiagnosticMessage.java.

71 {
72 String message = jsonObject.get("message").getAsString();
73 Location location = Location.fromJson(jsonObject.get("location").getAsJsonObject());
74 return new DiagnosticMessage(message, location);
75 }

◆ fromJsonArray()

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

Definition at line 77 of file DiagnosticMessage.java.

77 {
78 if (jsonArray == null) {
79 return EMPTY_LIST;
80 }
81 ArrayList<DiagnosticMessage> list = new ArrayList<DiagnosticMessage>(jsonArray.size());
82 Iterator<JsonElement> iterator = jsonArray.iterator();
83 while (iterator.hasNext()) {
84 list.add(fromJson(iterator.next().getAsJsonObject()));
85 }
86 return list;
87 }
static DiagnosticMessage fromJson(JsonObject jsonObject)

◆ getLocation()

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

The location associated with or referenced by the message. Clients should provide the ability to navigate to the location.

Definition at line 93 of file DiagnosticMessage.java.

93 {
94 return location;
95 }

◆ getMessage()

String org.dartlang.analysis.server.protocol.DiagnosticMessage.getMessage ( )
inline

The message to be displayed to the user.

Definition at line 100 of file DiagnosticMessage.java.

100 {
101 return message;
102 }

◆ hashCode()

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

Definition at line 105 of file DiagnosticMessage.java.

105 {
106 HashCodeBuilder builder = new HashCodeBuilder();
107 builder.append(message);
108 builder.append(location);
109 return builder.toHashCode();
110 }

◆ toJson()

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

Definition at line 112 of file DiagnosticMessage.java.

112 {
113 JsonObject jsonObject = new JsonObject();
114 jsonObject.addProperty("message", message);
115 jsonObject.add("location", location.toJson());
116 return jsonObject;
117 }

◆ toString()

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

Definition at line 120 of file DiagnosticMessage.java.

120 {
121 StringBuilder builder = new StringBuilder();
122 builder.append("[");
123 builder.append("message=");
124 builder.append(message + ", ");
125 builder.append("location=");
126 builder.append(location);
127 builder.append("]");
128 return builder.toString();
129 }

Member Data Documentation

◆ EMPTY_ARRAY

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

Definition at line 37 of file DiagnosticMessage.java.

◆ EMPTY_LIST

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

Definition at line 39 of file DiagnosticMessage.java.


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