public void end(String tagName) { // Verify the tag name matches the expected tag. String topItem = getCurrentTagName(); if (!topItem.equalsIgnoreCase(tagName)) { throw new IllegalStateException("Specified tag \"" + tagName + "\" does not match the current element \"" + topItem + "\""); } // End the element. endImpl(topItem); }
public void end() { endImpl(getCurrentTagName()); }
/** * Assert that the current builder does not forbid end tags. * * @param operation the operation that the user is attempting * @throw {@link UnsupportedOperationException} if not supported */ private void assertEndTagNotForbidden(String operation) { if (getCurrentBuilder().isEndTagForbidden()) { throw new UnsupportedOperationException(getCurrentTagName() + " does not support " + operation); } }
public void onStart(String tagName, ElementBuilderBase<?> builder) { if (isEmpty) { isEmpty = false; } else if (stack.isEmpty()) { // Check that we aren't creating another top level element. throw new IllegalStateException("You can only build one top level element."); } else { // Check that the element supports children. assertEndTagNotForbidden("child elements"); if (!getCurrentBuilder().isChildElementSupported()) { throw new UnsupportedOperationException(getCurrentTagName() + " does not support child elements."); } } // Check that asElement hasn't already been called. if (isHtmlOrTextAdded) { throw new IllegalStateException("Cannot append an element after setting text of html."); } // Validate the tagName. assertValidTagName(tagName); maybeCloseStartTag(); stack.push(builder, tagName); isStartTagOpen = true; isStyleOpen = false; isStyleClosed = false; isHtmlOrTextAdded = false; }
public void end(String tagName) { // Verify the tag name matches the expected tag. String topItem = getCurrentTagName(); if (!topItem.equalsIgnoreCase(tagName)) { throw new IllegalStateException("Specified tag \"" + tagName + "\" does not match the current element \"" + topItem + "\""); } // End the element. endImpl(topItem); }
public void end(String tagName) { // Verify the tag name matches the expected tag. String topItem = getCurrentTagName(); if (!topItem.equalsIgnoreCase(tagName)) { throw new IllegalStateException("Specified tag \"" + tagName + "\" does not match the current element \"" + topItem + "\""); } // End the element. endImpl(topItem); }
public void end() { endImpl(getCurrentTagName()); }
public void end() { endImpl(getCurrentTagName()); }
/** * Assert that the current builder does not forbid end tags. * * @param operation the operation that the user is attempting * @throw {@link UnsupportedOperationException} if not supported */ private void assertEndTagNotForbidden(String operation) { if (getCurrentBuilder().isEndTagForbidden()) { throw new UnsupportedOperationException(getCurrentTagName() + " does not support " + operation); } }
/** * Assert that the current builder does not forbid end tags. * * @param operation the operation that the user is attempting * @throw {@link UnsupportedOperationException} if not supported */ private void assertEndTagNotForbidden(String operation) { if (getCurrentBuilder().isEndTagForbidden()) { throw new UnsupportedOperationException(getCurrentTagName() + " does not support " + operation); } }
public void onStart(String tagName, ElementBuilderBase<?> builder) { if (isEmpty) { isEmpty = false; } else if (stack.isEmpty()) { // Check that we aren't creating another top level element. throw new IllegalStateException("You can only build one top level element."); } else { // Check that the element supports children. assertEndTagNotForbidden("child elements"); if (!getCurrentBuilder().isChildElementSupported()) { throw new UnsupportedOperationException(getCurrentTagName() + " does not support child elements."); } } // Check that asElement hasn't already been called. if (isHtmlOrTextAdded) { throw new IllegalStateException("Cannot append an element after setting text of html."); } // Validate the tagName. assertValidTagName(tagName); maybeCloseStartTag(); stack.push(builder, tagName); isStartTagOpen = true; isStyleOpen = false; isStyleClosed = false; isHtmlOrTextAdded = false; }
public void onStart(String tagName, ElementBuilderBase<?> builder) { if (isEmpty) { isEmpty = false; } else if (stack.isEmpty()) { // Check that we aren't creating another top level element. throw new IllegalStateException("You can only build one top level element."); } else { // Check that the element supports children. assertEndTagNotForbidden("child elements"); if (!getCurrentBuilder().isChildElementSupported()) { throw new UnsupportedOperationException(getCurrentTagName() + " does not support child elements."); } } // Check that asElement hasn't already been called. if (isHtmlOrTextAdded) { throw new IllegalStateException("Cannot append an element after setting text of html."); } // Validate the tagName. assertValidTagName(tagName); maybeCloseStartTag(); stack.push(builder, tagName); isStartTagOpen = true; isStyleOpen = false; isStyleClosed = false; isHtmlOrTextAdded = false; }