| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| WriterStack |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one | |
| 3 | * or more contributor license agreements. See the NOTICE file | |
| 4 | * distributed with this work for additional information | |
| 5 | * regarding copyright ownership. The ASF licenses this file | |
| 6 | * to you under the Apache License, Version 2.0 (the | |
| 7 | * "License"); you may not use this file except in compliance | |
| 8 | * with the License. You may obtain a copy of the License at | |
| 9 | * | |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 11 | * | |
| 12 | * Unless required by applicable law or agreed to in writing, | |
| 13 | * software distributed under the License is distributed on an | |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| 15 | * KIND, either express or implied. See the License for the | |
| 16 | * specific language governing permissions and limitations under the License. | |
| 17 | */ | |
| 18 | package org.apache.shindig.social.core.util.xstream; | |
| 19 | ||
| 20 | /** | |
| 21 | * A writer stack is a simple stack that tracks the current location of the | |
| 22 | * writer. | |
| 23 | */ | |
| 24 | public interface WriterStack { | |
| 25 | ||
| 26 | /** | |
| 27 | * Peek into the current location of the writer. | |
| 28 | * | |
| 29 | * @return the name of the current node. | |
| 30 | */ | |
| 31 | String peek(); | |
| 32 | ||
| 33 | /** | |
| 34 | * @return the current namespace. | |
| 35 | */ | |
| 36 | NamespaceSet peekNamespace(); | |
| 37 | ||
| 38 | /** | |
| 39 | * Reset the stack to its default state. | |
| 40 | */ | |
| 41 | void reset(); | |
| 42 | ||
| 43 | /** | |
| 44 | * add a node name into the stack indicating that the writer has moved into a | |
| 45 | * new child element. | |
| 46 | * | |
| 47 | * @param name | |
| 48 | * the name of the new child element. | |
| 49 | * @param namespace | |
| 50 | * the namespace set associated with the current element. | |
| 51 | */ | |
| 52 | void push(String name, NamespaceSet namespace); | |
| 53 | ||
| 54 | /** | |
| 55 | * Remove and return the current node name, making the parent node the active | |
| 56 | * node name. | |
| 57 | * | |
| 58 | * @return the node name just removed from the stack. | |
| 59 | */ | |
| 60 | String pop(); | |
| 61 | ||
| 62 | /** | |
| 63 | * @return the size of the statck | |
| 64 | */ | |
| 65 | int size(); | |
| 66 | ||
| 67 | } |