a utility for generating JSON from SQL queries using JDBC
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.8 KiB

12 years ago
  1. /*
  2. * Copyright (C) 2010 Google Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.google.gson.stream;
  17. /**
  18. * Lexical scoping elements within a JSON reader or writer.
  19. *
  20. * @author Jesse Wilson
  21. * @since 1.6
  22. */
  23. final class JsonScope {
  24. /**
  25. * An array with no elements requires no separators or newlines before
  26. * it is closed.
  27. */
  28. static final int EMPTY_ARRAY = 1;
  29. /**
  30. * A array with at least one value requires a comma and newline before
  31. * the next element.
  32. */
  33. static final int NONEMPTY_ARRAY = 2;
  34. /**
  35. * An object with no name/value pairs requires no separators or newlines
  36. * before it is closed.
  37. */
  38. static final int EMPTY_OBJECT = 3;
  39. /**
  40. * An object whose most recent element is a key. The next element must
  41. * be a value.
  42. */
  43. static final int DANGLING_NAME = 4;
  44. /**
  45. * An object with at least one name/value pair requires a comma and
  46. * newline before the next element.
  47. */
  48. static final int NONEMPTY_OBJECT = 5;
  49. /**
  50. * No object or array has been started.
  51. */
  52. static final int EMPTY_DOCUMENT = 6;
  53. /**
  54. * A document with at an array or object.
  55. */
  56. static final int NONEMPTY_DOCUMENT = 7;
  57. /**
  58. * A document that's been closed and cannot be accessed.
  59. */
  60. static final int CLOSED = 8;
  61. }