MCPcopy Create free account
hub / github.com/boxbeam/RedLib / object

Method object

src/redempt/redlib/json/JSONParser.java:130–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128 }
129
130 private Object object() {
131 switch (peek()) {
132 case 't':
133 pos += 4;
134 return true;
135 case 'f':
136 pos += 5;
137 return false;
138 case 'n':
139 pos += 4;
140 return null;
141 case '-':
142 case '0':
143 case '1':
144 case '2':
145 case '3':
146 case '4':
147 case '5':
148 case '6':
149 case '7':
150 case '8':
151 case '9':
152 Number num = integer();
153 if (peek() == '.') {
154 return decimal(num.longValue());
155 }
156 return num;
157 case '.':
158 return decimal(0);
159 case '"':
160 return string();
161 case '[':
162 return list();
163 case '{':
164 return map();
165 default:
166 throw new IllegalArgumentException("Invalid JSON, unknown token at position " + pos);
167 }
168 }
169
170 private JSONList list() {
171 assertChar('[');

Callers 2

listMethod · 0.95
mapMethod · 0.95

Calls 6

peekMethod · 0.95
integerMethod · 0.95
decimalMethod · 0.95
stringMethod · 0.95
listMethod · 0.95
mapMethod · 0.95

Tested by

no test coverage detected