本文整理汇总了Java中org.yaml.snakeyaml.error.Mark类的典型用法代码示例。如果您正苦于以下问题:Java Mark类的具体用法?Java Mark怎么用?Java Mark使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Mark类属于org.yaml.snakeyaml.error包,在下文中一共展示了Mark类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: produce
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public Event produce() {
// Parse the document end.
Token token = scanner.peekToken();
Mark startMark = token.getStartMark();
Mark endMark = startMark;
boolean explicit = false;
if (scanner.checkToken(Token.ID.DocumentEnd)) {
token = scanner.getToken();
endMark = token.getEndMark();
explicit = true;
}
Event event = new DocumentEndEvent(startMark, endMark, explicit);
// Prepare the next state.
state = new ParseDocumentStart();
return event;
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:17,代码来源:ParserImpl.java
示例2: fetchStreamEnd
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
private void fetchStreamEnd() {
// Set the current intendation to -1.
unwindIndent(-1);
// Reset simple keys.
removePossibleSimpleKey();
this.allowSimpleKey = false;
this.possibleSimpleKeys.clear();
// Read the token.
Mark mark = reader.getMark();
// Add STREAM-END.
Token token = new StreamEndToken(mark, mark);
this.tokens.add(token);
// The stream is finished.
this.done = true;
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:20,代码来源:ScannerImpl.java
示例3: scanDirectiveIgnoredLine
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
private String scanDirectiveIgnoredLine(Mark startMark) {
// See the specification for details.
while (reader.peek() == ' ') {
reader.forward();
}
if (reader.peek() == '#') {
while (Constant.NULL_OR_LINEBR.hasNo(reader.peek())) {
reader.forward();
}
}
int c = reader.peek();
String lineBreak = scanLineBreak();
if (lineBreak.length() == 0 && c != '\0') {
final String s = String.valueOf(Character.toChars(c));
throw new ScannerException("while scanning a directive", startMark,
"expected a comment or a line break, but found " + s + "(" + c + ")",
reader.getMark());
}
return lineBreak;
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:21,代码来源:ScannerImpl.java
示例4: scanTagDirectiveValue
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
/**
* <p>
* Read a %TAG directive value:
*
* <pre>
* s-ignored-space+ c-tag-handle s-ignored-space+ ns-tag-prefix s-l-comments
* </pre>
*
* </p>
*
* @see <a href="http://www.yaml.org/spec/1.1/#id896044"></a>
*/
private List<String> scanTagDirectiveValue(Mark startMark) {
// See the specification for details.
while (reader.peek() == ' ') {
reader.forward();
}
String handle = scanTagDirectiveHandle(startMark);
while (reader.peek() == ' ') {
reader.forward();
}
String prefix = scanTagDirectivePrefix(startMark);
List<String> result = new ArrayList<String>(2);
result.add(handle);
result.add(prefix);
return result;
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:28,代码来源:ScannerImpl.java
示例5: scanFlowScalarBreaks
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
private String scanFlowScalarBreaks(Mark startMark) {
// See the specification for details.
StringBuilder chunks = new StringBuilder();
while (true) {
// Instead of checking indentation, we check for document
// separators.
String prefix = reader.prefix(3);
if (("---".equals(prefix) || "...".equals(prefix))
&& Constant.NULL_BL_T_LINEBR.has(reader.peek(3))) {
throw new ScannerException("while scanning a quoted scalar", startMark,
"found unexpected document separator", reader.getMark());
}
// Scan past any number of spaces and tabs, ignoring them
while (" \t".indexOf(reader.peek()) != -1) {
reader.forward();
}
// If we stopped at a line break, add that; otherwise, return the
// assembled set of scalar breaks.
String lineBreak = scanLineBreak();
if (lineBreak.length() != 0) {
chunks.append(lineBreak);
} else {
return chunks.toString();
}
}
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:27,代码来源:ScannerImpl.java
示例6: ParserImpl
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public ParserImpl(Scanner scanner) {
this.scanner = scanner;
currentEvent = null;
directives = new VersionTagsTuple(null, new HashMap<String, String>(DEFAULT_TAGS));
states = new ArrayStack<Production>(100);
marks = new ArrayStack<Mark>(10);
state = new ParseStreamStart();
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:9,代码来源:ParserImpl.java
示例7: DirectiveToken
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public DirectiveToken(String name, List<T> value, Mark startMark, Mark endMark) {
super(startMark, endMark);
this.name = name;
if (value != null && value.size() != 2) {
throw new YAMLException("Two strings must be provided instead of "
+ String.valueOf(value.size()));
}
this.value = value;
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:10,代码来源:DirectiveToken.java
示例8: SequenceNode
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public SequenceNode(Tag tag, boolean resolved, List<Node> value, Mark startMark, Mark endMark,
Boolean flowStyle) {
super(tag, startMark, endMark, flowStyle);
if (value == null) {
throw new NullPointerException("value in a Node is required.");
}
this.value = value;
this.resolved = resolved;
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:10,代码来源:SequenceNode.java
示例9: ScalarNode
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public ScalarNode(Tag tag, boolean resolved, String value, Mark startMark, Mark endMark,
Character style) {
super(tag, startMark, endMark);
if (value == null) {
throw new NullPointerException("value in a Node is required.");
}
this.value = value;
this.style = style;
this.resolved = resolved;
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:11,代码来源:ScalarNode.java
示例10: Node
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public Node(Tag tag, Mark startMark, Mark endMark) {
setTag(tag);
this.startMark = startMark;
this.endMark = endMark;
this.type = Object.class;
this.twoStepsConstruction = false;
this.resolved = true;
this.useClassConstructor = null;
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:10,代码来源:Node.java
示例11: MappingNode
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public MappingNode(Tag tag, boolean resolved, List<NodeTuple> value, Mark startMark,
Mark endMark, Boolean flowStyle) {
super(tag, startMark, endMark, flowStyle);
if (value == null) {
throw new NullPointerException("value in a Node is required.");
}
this.value = value;
this.resolved = resolved;
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:10,代码来源:MappingNode.java
示例12: DocumentStartEvent
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public DocumentStartEvent(Mark startMark, Mark endMark, boolean explicit, Version version,
Map<String, String> tags) {
super(startMark, endMark);
this.explicit = explicit;
this.version = version;
// TODO enforce not null
// if (tags == null) {
// throw new NullPointerException("Tags must be provided.");
// }
this.tags = tags;
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:12,代码来源:DocumentStartEvent.java
示例13: fetchBlockEntry
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
/**
* Fetch an entry in the block style.
*
* @see <a href="http://www.yaml.org/spec/1.1/#id863975"></a>
*/
private void fetchBlockEntry() {
// Block context needs additional checks.
if (this.flowLevel == 0) {
// Are we allowed to start a new entry?
if (!this.allowSimpleKey) {
throw new ScannerException(null, null, "sequence entries are not allowed here",
reader.getMark());
}
// We may need to add BLOCK-SEQUENCE-START.
if (addIndent(this.reader.getColumn())) {
Mark mark = reader.getMark();
this.tokens.add(new BlockSequenceStartToken(mark, mark));
}
} else {
// It's an error for the block entry to occur in the flow
// context,but we let the parser detect this.
}
// Simple keys are allowed after '-'.
this.allowSimpleKey = true;
// Reset possible simple key on the current level.
removePossibleSimpleKey();
// Add BLOCK-ENTRY.
Mark startMark = reader.getMark();
reader.forward();
Mark endMark = reader.getMark();
Token token = new BlockEntryToken(startMark, endMark);
this.tokens.add(token);
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:37,代码来源:ScannerImpl.java
示例14: fetchKey
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
/**
* Fetch a key in a block-style mapping.
*
* @see <a href="http://www.yaml.org/spec/1.1/#id863975"></a>
*/
private void fetchKey() {
// Block context needs additional checks.
if (this.flowLevel == 0) {
// Are we allowed to start a key (not necessary a simple)?
if (!this.allowSimpleKey) {
throw new ScannerException(null, null, "mapping keys are not allowed here",
reader.getMark());
}
// We may need to add BLOCK-MAPPING-START.
if (addIndent(this.reader.getColumn())) {
Mark mark = reader.getMark();
this.tokens.add(new BlockMappingStartToken(mark, mark));
}
}
// Simple keys are allowed after '?' in the block context.
this.allowSimpleKey = this.flowLevel == 0;
// Reset possible simple key on the current level.
removePossibleSimpleKey();
// Add KEY.
Mark startMark = reader.getMark();
reader.forward();
Mark endMark = reader.getMark();
Token token = new KeyToken(startMark, endMark);
this.tokens.add(token);
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:33,代码来源:ScannerImpl.java
示例15: CollectionStartEvent
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public CollectionStartEvent(String anchor, String tag, boolean implicit, Mark startMark,
Mark endMark, Boolean flowStyle) {
super(anchor, startMark, endMark);
this.tag = tag;
this.implicit = implicit;
this.flowStyle = flowStyle;
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:8,代码来源:CollectionStartEvent.java
示例16: SimpleKey
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public SimpleKey(int tokenNumber, boolean required, int index, int line, int column, Mark mark) {
this.tokenNumber = tokenNumber;
this.required = required;
this.index = index;
this.line = line;
this.column = column;
this.mark = mark;
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:9,代码来源:SimpleKey.java
示例17: fetchFlowEntry
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
/**
* Fetch an entry in the flow style. Flow-style entries occur either
* immediately after the start of a collection, or else after a comma.
*
* @see <a href="http://www.yaml.org/spec/1.1/#id863975"></a>
*/
private void fetchFlowEntry() {
// Simple keys are allowed after ','.
this.allowSimpleKey = true;
// Reset possible simple key on the current level.
removePossibleSimpleKey();
// Add FLOW-ENTRY.
Mark startMark = reader.getMark();
reader.forward();
Mark endMark = reader.getMark();
Token token = new FlowEntryToken(startMark, endMark);
this.tokens.add(token);
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:21,代码来源:ScannerImpl.java
示例18: scanUriEscapes
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
/**
* <p>
* Scan a sequence of %-escaped URI escape codes and convert them into a
* String representing the unescaped values.
* </p>
*
* FIXME This method fails for more than 256 bytes' worth of URI-encoded
* characters in a row. Is this possible? Is this a use-case?
*
* @see <a href="http://www.ietf.org/rfc/rfc2396.txt"></a>, section 2.4, Escaped Encoding.
*/
private String scanUriEscapes(String name, Mark startMark) {
// First, look ahead to see how many URI-escaped characters we should
// expect, so we can use the correct buffer size.
int length = 1;
while (reader.peek(length * 3) == '%') {
length++;
}
// See the specification for details.
// URIs containing 16 and 32 bit Unicode characters are
// encoded in UTF-8, and then each octet is written as a
// separate character.
Mark beginningMark = reader.getMark();
ByteBuffer buff = ByteBuffer.allocate(length);
while (reader.peek() == '%') {
reader.forward();
try {
byte code = (byte) Integer.parseInt(reader.prefix(2), 16);
buff.put(code);
} catch (NumberFormatException nfe) {
int c1 = reader.peek();
final String s1 = String.valueOf(Character.toChars(c1));
int c2 = reader.peek(1);
final String s2 = String.valueOf(Character.toChars(c2));
throw new ScannerException("while scanning a " + name, startMark,
"expected URI escape sequence of 2 hexadecimal numbers, but found "
+ s1 + "(" + c1 + ") and "
+ s2 + "(" + c2 + ")",
reader.getMark());
}
reader.forward(2);
}
buff.flip();
try {
return UriEncoder.decode(buff);
} catch (CharacterCodingException e) {
throw new ScannerException("while scanning a " + name, startMark,
"expected URI in UTF-8: " + e.getMessage(), beginningMark);
}
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:51,代码来源:ScannerImpl.java
示例19: ScalarEvent
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
public ScalarEvent(String anchor, String tag, ImplicitTuple implicit, String value,
Mark startMark, Mark endMark, Character style) {
super(anchor, startMark, endMark);
this.tag = tag;
this.implicit = implicit;
this.value = value;
this.style = style;
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:9,代码来源:ScalarEvent.java
示例20: fetchStreamStart
import org.yaml.snakeyaml.error.Mark; //导入依赖的package包/类
/**
* We always add STREAM-START as the first token and STREAM-END as the last
* token.
*/
private void fetchStreamStart() {
// Read the token.
Mark mark = reader.getMark();
// Add STREAM-START.
Token token = new StreamStartToken(mark, mark);
this.tokens.add(token);
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:13,代码来源:ScannerImpl.java
注:本文中的org.yaml.snakeyaml.error.Mark类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论