|
|||||||||||||||||||
This license of Clover is provided to support the development of JBind only. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover. | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
DebugVisitor.java | - | 0% | 0% | 0% |
|
1 |
/* |
|
2 |
* JBind |
|
3 |
* |
|
4 |
* Copyright (c) by Stefan Wachter. All rights reserved. |
|
5 |
* |
|
6 |
* Usage, modification, and redistribution is subject to license terms that are |
|
7 |
* available at 'http://www.jbind.org'. The JBind license is like the |
|
8 |
* 'Apache Software License V 1.1'. |
|
9 |
*/ |
|
10 |
package org.jbind.xml.instance.data; |
|
11 |
|
|
12 |
import org.jbind.util.collection.UnsynchronizedStack; |
|
13 |
import org.jbind.xml.core.data.IAnyTypeData; |
|
14 |
|
|
15 |
/** |
|
16 |
* |
|
17 |
*/ |
|
18 |
public class DebugVisitor extends DataVisitor { |
|
19 |
|
|
20 |
private UnsynchronizedStack myStack = new UnsynchronizedStack(); |
|
21 |
|
|
22 | 0 |
public DebugVisitor() { |
23 | 0 |
myStack.push(new StringBuffer("dataVisitor: ")); |
24 |
} |
|
25 |
|
|
26 | 0 |
private StringBuffer pop() { |
27 | 0 |
return (StringBuffer)myStack.pop(); |
28 |
} |
|
29 | 0 |
private StringBuffer peek() { |
30 | 0 |
return (StringBuffer)myStack.peek(); |
31 |
} |
|
32 | 0 |
private void push(StringBuffer aStringBuffer) { |
33 | 0 |
myStack.push(aStringBuffer); |
34 |
} |
|
35 |
|
|
36 | 0 |
public void visitAnyDataStarts(IAnyTypeData aData) { |
37 | 0 |
StringBuffer sb = new StringBuffer(peek().toString()); |
38 | 0 |
System.out.println(sb.toString() + aData); |
39 | 0 |
sb.append(" "); |
40 | 0 |
push(sb); |
41 |
} |
|
42 | 0 |
public void visitAnyDataEnds(IAnyTypeData aData) { |
43 | 0 |
pop(); |
44 | 0 |
StringBuffer sb = peek(); |
45 | 0 |
System.out.println(sb.toString() + "<-"); |
46 |
} |
|
47 |
} |
|
48 |
|
|