本文整理汇总了Java中com.thoughtworks.xstream.io.xml.XppReader.moveUp方法的典型用法代码示例。如果您正苦于以下问题:Java XppReader.moveUp方法的具体用法?Java XppReader.moveUp怎么用?Java XppReader.moveUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.thoughtworks.xstream.io.xml.XppReader
的用法示例。
在下文中一共展示了XppReader.moveUp方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseCallSignature
import com.thoughtworks.xstream.io.xml.XppReader; //导入方法依赖的package包/类
public static PySignature parseCallSignature(String payload) throws PyDebuggerException {
final XppReader reader = openReader(payload, true);
reader.moveDown();
if (!"call_signature".equals(reader.getNodeName())) {
throw new PyDebuggerException("Expected <call_signature>, found " + reader.getNodeName());
}
final String file = readString(reader, "file", "");
final String name = readString(reader, "name", "");
PySignature signature = new PySignature(file, name);
while (reader.hasMoreChildren()) {
reader.moveDown();
if (!"arg".equals(reader.getNodeName())) {
throw new PyDebuggerException("Expected <arg>, found " + reader.getNodeName());
}
signature.addArgument(readString(reader, "name", ""), readString(reader, "type", ""));
reader.moveUp();
}
return signature;
}
示例2: parseThread
import com.thoughtworks.xstream.io.xml.XppReader; //导入方法依赖的package包/类
@NotNull
public static PyThreadInfo parseThread(final String text, final PyPositionConverter positionConverter) throws PyDebuggerException {
final XppReader reader = openReader(text, true);
reader.moveDown();
if (!"thread".equals(reader.getNodeName())) {
throw new PyDebuggerException("Expected <thread>, found " + reader.getNodeName());
}
final String id = readString(reader, "id", null);
final String name = readString(reader, "name", "");
final int stopReason = readInt(reader, "stop_reason", 0);
String message = readString(reader, "message", "None");
if ("None".equals(message)) {
message = null;
}
final List<PyStackFrameInfo> frames = new LinkedList<PyStackFrameInfo>();
while (reader.hasMoreChildren()) {
reader.moveDown();
frames.add(parseFrame(reader, id, positionConverter));
reader.moveUp();
}
return new PyThreadInfo(id, name, frames, stopReason, message);
}
示例3: parseReferrers
import com.thoughtworks.xstream.io.xml.XppReader; //导入方法依赖的package包/类
@NotNull
public static List<PyDebugValue> parseReferrers(final String text, final PyFrameAccessor frameAccessor) throws PyDebuggerException {
final List<PyDebugValue> values = new LinkedList<PyDebugValue>();
final XppReader reader = openReader(text, false);
while (reader.hasMoreChildren()) {
reader.moveDown();
if (reader.getNodeName().equals("var")) {
PyDebugValue value = parseValue(reader, frameAccessor);
value.setId(readString(reader, "id", null));
values.add(value);
}
else if (reader.getNodeName().equals("for")) {
//TODO
}
else {
throw new PyDebuggerException("Expected <var> or <for>, found " + reader.getNodeName());
}
reader.moveUp();
}
return values;
}
示例4: parseArrayValues
import com.thoughtworks.xstream.io.xml.XppReader; //导入方法依赖的package包/类
public static ArrayChunk parseArrayValues(final String text, final PyFrameAccessor frameAccessor) throws PyDebuggerException {
final XppReader reader = openReader(text, false);
ArrayChunk result = null;
if (reader.hasMoreChildren()) {
reader.moveDown();
if (!"array".equals(reader.getNodeName())) {
throw new PyDebuggerException("Expected <array> at first node, found " + reader.getNodeName());
}
String slice = readString(reader, "slice", null);
int rows = readInt(reader, "rows", null);
int cols = readInt(reader, "cols", null);
String format = "%" + readString(reader, "format", null);
String type = readString(reader, "type", null);
String max = readString(reader, "max", null);
String min = readString(reader, "min", null);
result =
new ArrayChunk(new PyDebugValue(slice, null, null, false, false, frameAccessor), slice, rows, cols, max, min, format, type, null);
reader.moveUp();
}
Object[][] data = parseArrayValues(reader, frameAccessor);
return new ArrayChunk(result.getValue(), result.getSlicePresentation(), result.getRows(), result.getColumns(), result.getMax(),
result.getMin(), result.getFormat(), result.getType(), data);
}
示例5: parseValues
import com.thoughtworks.xstream.io.xml.XppReader; //导入方法依赖的package包/类
@NotNull
public static List<PyDebugValue> parseValues(final String text, final PyFrameAccessor frameAccessor) throws PyDebuggerException {
final List<PyDebugValue> values = new LinkedList<PyDebugValue>();
final XppReader reader = openReader(text, false);
while (reader.hasMoreChildren()) {
reader.moveDown();
values.add(parseValue(reader, frameAccessor));
reader.moveUp();
}
return values;
}
示例6: parseConcurrencyEvent
import com.thoughtworks.xstream.io.xml.XppReader; //导入方法依赖的package包/类
public static PyConcurrencyEvent parseConcurrencyEvent(String payload,
final PyPositionConverter positionConverter) throws PyDebuggerException {
final XppReader reader = openReader(payload, true);
reader.moveDown();
String eventName = reader.getNodeName();
boolean isAsyncio;
if (eventName.equals("threading_event")) {
isAsyncio = false;
} else if (eventName.equals("asyncio_event")) {
isAsyncio = true;
} else {
throw new PyDebuggerException("Expected <threading_event> or <asyncio_event>, found " + reader.getNodeName());
}
final Long time = Long.parseLong(readString(reader, "time", ""));
final String name = readString(reader, "name", "");
final String thread_id = readString(reader, "thread_id", "");
final String type = readString(reader, "type", "");
PyConcurrencyEvent threadingEvent;
if (type.equals("lock")) {
String lock_id = readString(reader, "lock_id", "0");
threadingEvent = new PyLockEvent(time, thread_id, name, lock_id, isAsyncio);
}
else if (type.equals("thread")) {
String parentThread = readString(reader, "parent", "");
if (!parentThread.isEmpty()) {
threadingEvent = new PyThreadEvent(time, thread_id, name, parentThread, isAsyncio);
} else {
threadingEvent = new PyThreadEvent(time, thread_id, name, isAsyncio);
}
}
else {
throw new PyDebuggerException("Unknown type " + type);
}
final String eventType = readString(reader, "event", "");
if (eventType.equals("__init__")) {
threadingEvent.setType(PyConcurrencyEvent.EventType.CREATE);
}
else if (eventType.equals("start")) {
threadingEvent.setType(PyConcurrencyEvent.EventType.START);
}
else if (eventType.equals("join")) {
threadingEvent.setType(PyConcurrencyEvent.EventType.JOIN);
}
else if (eventType.equals("stop")) {
threadingEvent.setType(PyConcurrencyEvent.EventType.STOP);
}
else if (eventType.equals("acquire_begin") || eventType.equals("__enter___begin")
|| (eventType.equals("get_begin")) || (eventType.equals("put_begin"))) {
threadingEvent.setType(PyConcurrencyEvent.EventType.ACQUIRE_BEGIN);
}
else if (eventType.equals("acquire_end") || eventType.equals("__enter___end")
|| (eventType.equals("get_end")) || (eventType.equals("put_end"))) {
threadingEvent.setType(PyConcurrencyEvent.EventType.ACQUIRE_END);
}
else if (eventType.startsWith("release") || eventType.startsWith("__exit__")) {
// we record release begin and end on the Python side, but it is not important info
// for user. Maybe use it later
threadingEvent.setType(PyConcurrencyEvent.EventType.RELEASE);
}
else {
throw new PyDebuggerException("Unknown event " + eventType);
}
threadingEvent.setFileName(readString(reader, "file", ""));
threadingEvent.setLine(Integer.parseInt(readString(reader, "line", "")) - 1);
reader.moveUp();
final List<PyStackFrameInfo> frames = new LinkedList<PyStackFrameInfo>();
while (reader.hasMoreChildren()) {
reader.moveDown();
frames.add(parseFrame(reader, thread_id, positionConverter));
reader.moveUp();
}
threadingEvent.setFrames(frames);
return threadingEvent;
}