private Node composeNode(Node parent) { if (parent != null) recursiveNodes.add(parent); final Node node; if (parser.checkEvent(Event.ID.Alias)) { AliasEvent event = (AliasEvent) parser.getEvent(); String anchor = event.getAnchor(); if (!anchors.containsKey(anchor)) { throw new ComposerException(null, null, "found undefined alias " + anchor, event.getStartMark()); } node = anchors.get(anchor); if (recursiveNodes.remove(node)) { node.setTwoStepsConstruction(true); } } else { NodeEvent event = (NodeEvent) parser.peekEvent(); String anchor = event.getAnchor(); // the check for duplicate anchors has been removed (issue 174) if (parser.checkEvent(Event.ID.Scalar)) { node = composeScalarNode(anchor); } else if (parser.checkEvent(Event.ID.SequenceStart)) { node = composeSequenceNode(anchor); } else { node = composeMappingNode(anchor); } } recursiveNodes.remove(parent); return node; }
@Override public void alias(AliasEvent evt, YsldValidateContext context) { switch (state) { case NEW: state = State.DONE; context.pop(); break; case STARTED: break; default: context.error( String.format("Unexpected alias '%s'", evt.getAnchor()), evt.getStartMark()); break; } } }
@Override public void alias(AliasEvent evt, YsldValidateContext context) { switch (state) { case NEW: state = State.DONE; context.pop(); break; case STARTED: break; default: context.error( String.format("Unexpected alias '%s'", evt.getAnchor()), evt.getStartMark()); break; } } }
@Override public void alias(AliasEvent evt, YsldValidateContext context) { switch (state) { case NEW: // Can't validate this so just move on. state = State.DONE; context.pop(); break; case STARTED: // Can't validate this so just move on. valuesValidated++; break; default: context.error( String.format("Unexpected alias '%s'", evt.getAnchor()), evt.getStartMark()); break; } } }
AliasEvent alias = (AliasEvent) evt; _currentIsAlias = true; _textValue = alias.getAnchor(); _cleanedTextValue = null;
AliasEvent alias = (AliasEvent) evt; _currentIsAlias = true; _textValue = alias.getAnchor(); _cleanedTextValue = null;
public void addAliasEvent(AliasEvent event, String name) throws SAXException { contentHandler.addContentElement(name, null, event.getAnchor(), false); }
public void addAliasEvent(AliasEvent event, String name) throws SAXException { contentHandler.addContentElement(name, null, event.getAnchor(), false); }
public void addAliasEvent(AliasEvent event, String name) throws SAXException { contentHandler.addContentElement(name, null, event.getAnchor(), false); }
public void addAliasEvent(AliasEvent event, String name) throws SAXException { contentHandler.addContentElement(name, null, event.getAnchor(), false); }
public void addAliasEvent(AliasEvent event, String name) throws SAXException { contentHandler.addContentElement(name, null, event.getAnchor(), false); }
@Override public void alias(AliasEvent evt, YsldValidateContext context) { switch (state) { case NEW: state = State.DONE; context.pop(); break; case STARTED: break; default: context.error( String.format("Unexpected alias '%s'", evt.getAnchor()), evt.getStartMark()); break; } } }
@Override public void alias(AliasEvent evt, YsldValidateContext context) { switch (state) { case NEW: state = State.DONE; context.pop(); break; case STARTED: break; default: context.error( String.format("Unexpected alias '%s'", evt.getAnchor()), evt.getStartMark()); break; } } }
@Override public void alias(AliasEvent evt, YsldValidateContext context) { switch (state) { case NEW: // Can't validate this so just move on. state = State.DONE; context.pop(); break; case STARTED: // Can't validate this so just move on. valuesValidated++; break; default: context.error( String.format("Unexpected alias '%s'", evt.getAnchor()), evt.getStartMark()); break; } } }
private Node composeNode(Node parent) { recursiveNodes.add(parent); if (parser.checkEvent(Event.ID.Alias)) { AliasEvent event = (AliasEvent) parser.getEvent(); String anchor = event.getAnchor(); if (!anchors.containsKey(anchor)) { throw new ComposerException(null, null, "found undefined alias " + anchor, event.getStartMark()); } Node result = anchors.get(anchor); if (recursiveNodes.remove(result)) { result.setTwoStepsConstruction(true); } return result; } NodeEvent event = (NodeEvent) parser.peekEvent(); String anchor = null; anchor = event.getAnchor(); // the check for duplicate anchors has been removed (issue 174) Node node = null; if (parser.checkEvent(Event.ID.Scalar)) { node = composeScalarNode(anchor); } else if (parser.checkEvent(Event.ID.SequenceStart)) { node = composeSequenceNode(anchor); } else { node = composeMappingNode(anchor); } recursiveNodes.remove(parent); return node; }
private Node composeNode(Node parent) { recursiveNodes.add(parent); Node node = null; if (parser.checkEvent(Event.ID.Alias)) { AliasEvent event = (AliasEvent) parser.getEvent(); String anchor = event.getAnchor(); if (!anchors.containsKey(anchor)) { throw new ComposerException(null, null, "found undefined alias " + anchor, event.getStartMark()); } node = anchors.get(anchor); if (recursiveNodes.remove(node)) { node.setTwoStepsConstruction(true); } } else { NodeEvent event = (NodeEvent) parser.peekEvent(); String anchor = null; anchor = event.getAnchor(); // the check for duplicate anchors has been removed (issue 174) if (parser.checkEvent(Event.ID.Scalar)) { node = composeScalarNode(anchor); } else if (parser.checkEvent(Event.ID.SequenceStart)) { node = composeSequenceNode(anchor); } else { node = composeMappingNode(anchor); } } recursiveNodes.remove(parent); return node; }
private Node composeNode(Node parent) { recursiveNodes.add(parent); Node node = null; if (parser.checkEvent(Event.ID.Alias)) { AliasEvent event = (AliasEvent) parser.getEvent(); String anchor = event.getAnchor(); if (!anchors.containsKey(anchor)) { throw new ComposerException(null, null, "found undefined alias " + anchor, event.getStartMark()); } node = anchors.get(anchor); if (recursiveNodes.remove(node)) { node.setTwoStepsConstruction(true); } } else { NodeEvent event = (NodeEvent) parser.peekEvent(); String anchor = null; anchor = event.getAnchor(); // the check for duplicate anchors has been removed (issue 174) if (parser.checkEvent(Event.ID.Scalar)) { node = composeScalarNode(anchor); } else if (parser.checkEvent(Event.ID.SequenceStart)) { node = composeSequenceNode(anchor); } else { node = composeMappingNode(anchor); } } recursiveNodes.remove(parent); return node; }
public void addAliasEvent(AliasEvent event, String name) throws SAXException { String anchorName = event.getAnchor();
public void addAliasEvent(AliasEvent event, String name) throws SAXException { String anchorName = event.getAnchor();
private NodeEvent nextNodeEvent(final Parser parser) throws ParserException { if (parser.checkEvent(Event.ID.Alias)) { final AliasEvent event = (AliasEvent) parser.getEvent(); final String anchor = event.getAnchor(); throw new ParserException("Encounter node alias '" + anchor + "' which is not supported when parsing a document head only, " + event.getStartMark().toString()); } else { final NodeEvent event = (NodeEvent) parser.getEvent(); final String anchor = event.getAnchor(); if (anchor != null) { throw new ParserException("Encountered node anchor '" + anchor + "' which is not supported when parsing a document head only, " + event.getStartMark().toString()); } return event; } }