MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / Result

Class Result

CodenameOne/src/com/codename1/processing/Result.java:91–1314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89///
90/// @author Eric Coolman (2012-03 - derivative work from original Sun source).
91public final class Result {
92
93 public static final String JSON = "json";
94 public static final String XML = "xml";
95 public static final char SEPARATOR = '/';
96 public static final char ARRAY_START = '[';
97 public static final char ARRAY_END = ']';
98 private static final Object SELECT_GLOB = "//";
99 private static final Object SELECT_PARENT = "..";
100
101 private StructuredContent root;
102 private Map namespaceAliases;
103
104 /// Internal method, do not use.
105 ///
106 /// Construct an evaluator object from a StructuredContent element.
107 ///
108 /// #### Parameters
109 ///
110 /// - `content`: a parsed dom
111 ///
112 /// #### Returns
113 ///
114 /// Result a result evaluator object
115 ///
116 /// #### Throws
117 ///
118 /// - `IllegalArgumentException`: thrown if null content is passed.
119 private Result(final StructuredContent obj, boolean subTree) throws IllegalArgumentException {
120 if (obj == null) {
121 throw new IllegalArgumentException("dom object cannot be null");
122 }
123 this.root = obj;
124 if (!subTree && root.getParent() != null) {
125 root = root.getParent(); // <--- WHY??
126 }
127 }
128
129 /// Internal method, do not use.
130 ///
131 /// Create an evaluator object from a StructuredContent element.
132 ///
133 /// #### Parameters
134 ///
135 /// - `content`: a parsed dom
136 ///
137 /// - `subTree`: If true, then this is treated as a subtree, and won't try to take the parent as the actual root.
138 ///
139 /// #### Returns
140 ///
141 /// Result a result evaluator object
142 ///
143 /// #### Throws
144 ///
145 /// - `IllegalArgumentException`: thrown if null content is passed.
146 static Result fromContent(StructuredContent content, boolean subTree)
147 throws IllegalArgumentException {
148 if (content == null) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected