Changeset 13231 in josm for trunk/src/javax/json/spi
- Timestamp:
- 2017-12-23T02:40:43+01:00 (7 years ago)
- Location:
- trunk/src/javax/json/spi
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/javax/json/spi/JsonProvider.java
r6756 r13231 2 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 3 * 4 * Copyright (c) 2011-201 3Oracle and/or its affiliates. All rights reserved.4 * Copyright (c) 2011-2017 Oracle and/or its affiliates. All rights reserved. 5 5 * 6 6 * The contents of this file are subject to the terms of either the GNU … … 9 9 * may not use this file except in compliance with the License. You can 10 10 * obtain a copy of the License at 11 * https:// glassfish.dev.java.net/public/CDDL+GPL_1_1.html12 * or packager/legal/LICENSE.txt. See the License for the specific11 * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 * or LICENSE.txt. See the License for the specific 13 13 * language governing permissions and limitations under the License. 14 14 * 15 15 * When distributing the software, include this License Header Notice in each 16 * file and include the License file at packager/legal/LICENSE.txt.16 * file and include the License file at LICENSE.txt. 17 17 * 18 18 * GPL Classpath Exception: … … 50 50 import java.io.Reader; 51 51 import java.io.Writer; 52 import java.util.Collection; 52 53 import java.util.Iterator; 53 54 import java.util.Map; 54 55 import java.util.ServiceLoader; 56 import java.math.BigDecimal; 57 import java.math.BigInteger; 58 import java.util.Optional; 55 59 56 60 /** … … 61 65 * 62 66 * @see ServiceLoader 63 * @author Jitendra Kotamraju64 67 */ 65 68 public abstract class JsonProvider { … … 76 79 77 80 /** 78 *79 81 * Creates a JSON provider object. The provider is loaded using the 80 82 * {@link ServiceLoader#load(Class)} method. If there are no available 81 83 * service providers, this method returns the default service provider. 84 * Users are recommended to cache the result of this method. 82 85 * 83 86 * @see ServiceLoader … … 90 93 return it.next(); 91 94 } 92 93 95 try { 94 96 Class<?> clazz = Class.forName(DEFAULT_PROVIDER); 95 return (JsonProvider) clazz.newInstance();97 return (JsonProvider) clazz.newInstance(); 96 98 } catch (ClassNotFoundException x) { 97 99 throw new JsonException( … … 115 117 * Creates a JSON parser from the specified byte stream. 116 118 * The character encoding of the stream is determined 117 * as defined in <a href="http://tools.ietf.org/rfc/rfc 4627.txt">RFC 4627119 * as defined in <a href="http://tools.ietf.org/rfc/rfc7159.txt">RFC 7159 118 120 * </a>. 119 121 * … … 193 195 * Creates a JSON reader from a byte stream. The character encoding of 194 196 * the stream is determined as described in 195 * <a href="http://tools.ietf.org/rfc/rfc 4627.txt">RFC 4627</a>.197 * <a href="http://tools.ietf.org/rfc/rfc7159.txt">RFC 7159</a>. 196 198 * 197 199 * @param in a byte stream from which JSON is to be read … … 246 248 247 249 /** 248 * Creates a JSON object builder 250 * Creates a JSON object builder. 249 251 * 250 252 * @return a JSON object builder … … 253 255 254 256 /** 255 * Creates a JSON array builder 257 * Creates a JSON object builder, initialized with the specified object. 258 * 259 * @param object the initial JSON object in the builder 260 * @return a JSON object builder 261 * 262 * @since 1.1 263 */ 264 public JsonObjectBuilder createObjectBuilder(JsonObject object) { 265 throw new UnsupportedOperationException(); 266 } 267 268 /** 269 * Creates a JSON object builder, initialized with the data from specified {@code map}. 270 * If the @{code map} contains {@link Optional}s then resulting JSON object builder 271 * contains the key from the {@code map} only if the {@link Optional} is not empty. 272 * 273 * @param map the initial object in the builder 274 * @return a JSON object builder 275 * @exception IllegalArgumentException if the value from the {@code map} cannot be converted 276 * to the corresponding {@link JsonValue} 277 * 278 * @since 1.1 279 */ 280 public JsonObjectBuilder createObjectBuilder(Map<String, Object> map) { 281 throw new UnsupportedOperationException(); 282 } 283 284 /** 285 * Creates a JSON array builder. 256 286 * 257 287 * @return a JSON array builder 258 288 */ 259 289 public abstract JsonArrayBuilder createArrayBuilder(); 290 291 /** 292 * Creates a JSON array builder, initialized with the specified array. 293 * 294 * @param array the initial JSON array in the builder 295 * @return a JSON array builder 296 * 297 * @since 1.1 298 */ 299 public JsonArrayBuilder createArrayBuilder(JsonArray array) { 300 throw new UnsupportedOperationException(); 301 } 302 303 /** 304 * Creates JSON Pointer (<a href="http://tools.ietf.org/html/rfc6901">RFC 6901</a>) 305 * from given {@code jsonPointer} string. 306 * <ul> 307 * <li>An empty {@code jsonPointer} string defines a reference to the target itself.</li> 308 * <li>If the {@code jsonPointer} string is non-empty, it must be a sequence of '{@code /}' prefixed tokens.</li> 309 * </ul> 310 * 311 * @param jsonPointer the JSON Pointer string 312 * @throws NullPointerException if {@code jsonPointer} is {@code null} 313 * @throws JsonException if {@code jsonPointer} is not a valid JSON Pointer 314 * @return a JSON Pointer 315 * 316 * @since 1.1 317 */ 318 public JsonPointer createPointer(String jsonPointer) { 319 throw new UnsupportedOperationException(); 320 } 321 322 /** 323 * Creates a JSON Patch builder (<a href="http://tools.ietf.org/html/rfc6902">RFC 6902</a>). 324 * 325 * @return a JSON Patch builder 326 * 327 * @since 1.1 328 */ 329 public JsonPatchBuilder createPatchBuilder() { 330 throw new UnsupportedOperationException(); 331 } 332 333 /** 334 * Creates a JSON Patch builder 335 * (<a href="http://tools.ietf.org/html/rfc6902">RFC 6902</a>), 336 * initialized with the specified operations. 337 * 338 * @param array the initial patch operations 339 * @return a JSON Patch builder 340 * 341 * @since 1.1 342 */ 343 public JsonPatchBuilder createPatchBuilder(JsonArray array) { 344 throw new UnsupportedOperationException(); 345 } 346 347 /** 348 * Creates a JSON Patch (<a href="http://tools.ietf.org/html/rfc6902">RFC 6902</a>) 349 * from the specified operations. 350 * 351 * @param array patch operations 352 * @return a JSON Patch 353 * 354 * @since 1.1 355 */ 356 public JsonPatch createPatch(JsonArray array) { 357 throw new UnsupportedOperationException(); 358 } 359 360 /** 361 * Generates a JSON Patch (<a href="http://tools.ietf.org/html/rfc6902">RFC 6902</a>) 362 * from the source and target {@code JsonStructure}. 363 * The generated JSON Patch need not be unique. 364 * 365 * @param source the source 366 * @param target the target, must be the same type as the source 367 * @return a JSON Patch which when applied to the source, yields the target 368 * 369 * @since 1.1 370 */ 371 public JsonPatch createDiff(JsonStructure source, JsonStructure target) { 372 throw new UnsupportedOperationException(); 373 } 374 375 /** 376 * Creates JSON Merge Patch (<a href="http://tools.ietf.org/html/rfc7396">RFC 7396</a>) 377 * from specified {@code JsonValue}. 378 * 379 * @param patch the patch 380 * @return a JSON Merge Patch 381 * 382 * @since 1.1 383 */ 384 public JsonMergePatch createMergePatch(JsonValue patch) { 385 throw new UnsupportedOperationException(); 386 } 387 388 /** 389 * Generates a JSON Merge Patch (<a href="http://tools.ietf.org/html/rfc7396">RFC 7396</a>) 390 * from the source and target {@code JsonValue}s 391 * which when applied to the {@code source}, yields the {@code target}. 392 * 393 * @param source the source 394 * @param target the target 395 * @return a JSON Merge Patch 396 * 397 * @since 1.1 398 */ 399 public JsonMergePatch createMergeDiff(JsonValue source, JsonValue target) { 400 throw new UnsupportedOperationException(); 401 } 402 403 /** 404 * Creates a JSON array builder, initialized with the content of specified {@code collection}. 405 * If the @{code collection} contains {@link Optional}s then resulting JSON array builder 406 * contains the value from the {@code collection} only if the {@link Optional} is not empty. 407 * 408 * @param collection the initial data for the builder 409 * @return a JSON array builder 410 * @exception IllegalArgumentException if the value from the {@code collection} cannot be converted 411 * to the corresponding {@link JsonValue} 412 * 413 * @since 1.1 414 */ 415 public JsonArrayBuilder createArrayBuilder(Collection<?> collection) { 416 throw new UnsupportedOperationException(); 417 } 418 260 419 261 420 /** … … 272 431 public abstract JsonBuilderFactory createBuilderFactory(Map<String,?> config); 273 432 433 /** 434 * Creates a JsonString. 435 * 436 * @param value a JSON string 437 * @return the JsonString for the string 438 * 439 * @since 1.1 440 */ 441 public JsonString createValue(String value) { 442 throw new UnsupportedOperationException(); 443 } 444 445 /** 446 * Creates a JsonNumber. 447 * 448 * @param value a JSON number 449 * @return the JsonNumber for the number 450 * 451 * @since 1.1 452 */ 453 public JsonNumber createValue(int value) { 454 throw new UnsupportedOperationException(); 455 } 456 457 /** 458 * Creates a JsonNumber. 459 * 460 * @param value a JSON number 461 * @return the JsonNumber for the number 462 * 463 * @since 1.1 464 */ 465 public JsonNumber createValue(long value) { 466 throw new UnsupportedOperationException(); 467 } 468 469 /** 470 * Creates a JsonNumber. 471 * 472 * @param value a JSON number 473 * @return the JsonNumber for the number 474 * 475 * @since 1.1 476 */ 477 public JsonNumber createValue(double value) { 478 throw new UnsupportedOperationException(); 479 } 480 481 /** 482 * Creates a JsonNumber. 483 * 484 * @param value a JSON number 485 * @return the JsonNumber for the number 486 * 487 * @since 1.1 488 */ 489 public JsonNumber createValue(BigDecimal value) { 490 throw new UnsupportedOperationException(); 491 } 492 493 /** 494 * Creates a JsonNumber. 495 * 496 * @param value a JSON number 497 * @return the JsonNumber for the number 498 * 499 * @since 1.1 500 */ 501 public JsonNumber createValue(BigInteger value) { 502 throw new UnsupportedOperationException(); 503 } 274 504 } -
trunk/src/javax/json/spi/package-info.java
r6756 r13231 2 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 3 * 4 * Copyright (c) 2012-201 3Oracle and/or its affiliates. All rights reserved.4 * Copyright (c) 2012-2017 Oracle and/or its affiliates. All rights reserved. 5 5 * 6 6 * The contents of this file are subject to the terms of either the GNU … … 9 9 * may not use this file except in compliance with the License. You can 10 10 * obtain a copy of the License at 11 * https:// glassfish.dev.java.net/public/CDDL+GPL_1_1.html12 * or packager/legal/LICENSE.txt. See the License for the specific11 * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 * or LICENSE.txt. See the License for the specific 13 13 * language governing permissions and limitations under the License. 14 14 * 15 15 * When distributing the software, include this License Header Notice in each 16 * file and include the License file at packager/legal/LICENSE.txt.16 * file and include the License file at LICENSE.txt. 17 17 * 18 18 * GPL Classpath Exception: … … 53 53 * 54 54 * @since JSON Processing 1.0 55 * @author Jitendra Kotamraju56 55 */ 57 56 package javax.json.spi;
Note:
See TracChangeset
for help on using the changeset viewer.