public boolean atEndOfAttributes(final Source source, final int pos, final boolean isClosingSlashIgnored) { final ParseText parseText=source.getParseText(); return parseText.charAt(pos)=='>' || (!isClosingSlashIgnored && parseText.containsAt("/>",pos)); } }
@Override public boolean atEndOfAttributes(final Source source, final int pos, final boolean isClosingSlashIgnored) { final ParseText parseText = source.getParseText(); return parseText.charAt(pos) == '>' || (parseText.containsAt("/>", pos)); }
/** * Indicates whether the specified source document position is at the end of a tag's {@linkplain Attributes attributes}. * <br />(<a href="TagType.html#DefaultImplementation">default implementation</a> method) * <p> * This method is called internally while parsing {@linkplain Attributes attributes} to detect where they should end. * <p> * It can be assumed that the specified position is not inside a quoted attribute value. * <p> * The default implementation simply compares the {@linkplain ParseText parse text} at the specified * position with the {@linkplain #getClosingDelimiter() closing delimiter}, and is equivalent to:<br /> * <code>source.</code>{@link Source#getParseText() getParseText()}<code>.containsAt(</code>{@link #getClosingDelimiter() getClosingDelimiter()}<code>,pos)</code> * <p> * The <code>isClosingSlashIgnored</code> parameter is only relevant in the {@link #NORMAL} start tag type, * which makes use of it to cater for the '<code>/</code>' character that can occur before the * {@linkplain #getClosingDelimiter() closing delimiter} in {@linkplain StartTag#isEmptyElementTag() empty-element tags}. * It's value is always <code>false</code> when passed to other start tag types. * * @param source the {@link Source} document. * @param pos the character position in the source document. * @param isClosingSlashIgnored indicates whether the {@linkplain StartTag#getName() name} of the {@linkplain StartTag start tag} being tested is incompatible with an {@linkplain StartTag#isEmptyElementTag() empty-element tag}. * @return <code>true</code> if the specified source document position is at the end of a tag's {@linkplain Attributes attributes}, otherwise <code>false</code>. */ public boolean atEndOfAttributes(final Source source, final int pos, final boolean isClosingSlashIgnored) { return source.getParseText().containsAt(getClosingDelimiter(),pos); }
protected int getEnd(final Source source, final int pos) { // This method needs to be overridden because this tag type shares the same start delimiter as the downlevel hidden conditional comment. // The closing delimiter of the other tag type must not appear inside this tag. // Take the following example: // <!--[if IE]> ... <![endif]--> ... <!--[if !(IE 5)]><!--> ... <!--<![endif]--> // If the default implementation were used, then the parser would recognise the first tag as: // <!--[if IE]> ... <![endif]--> ... <!--[if !(IE 5)]><!--> final int delimiterBegin=source.getParseText().indexOf(MicrosoftConditionalCommentTagTypes.DOWNLEVEL_HIDDEN_IF.getClosingDelimiter(),pos); if (delimiterBegin==-1) return -1; if (source.getParseText().containsAt(getClosingDelimiter(),delimiterBegin)) return delimiterBegin+getClosingDelimiter().length(); // this is a downlevel hidden conditional comment, so fail this tag type silently without displaying a log message return -2; } }
if (isStatic()) { name=getNamePrefix(); if (!parseText.containsAt(getClosingDelimiter(),startDelimiterEnd)) { if (source.logger.isErrorEnabled()) source.logger.error(source.getRowColumnVector(pos).appendTo(new StringBuilder(200).append("EndTag of expected format ").append(staticString).append(" at ")).append(" not recognised as type '").append(getDescription()).append("' because it is missing the closing delimiter").toString()); return null; int expectedClosingDelimiterPos=nameEnd; while (Segment.isWhiteSpace(parseText.charAt(expectedClosingDelimiterPos))) expectedClosingDelimiterPos++; if (!parseText.containsAt(getClosingDelimiter(),expectedClosingDelimiterPos)) { if (source.logger.isErrorEnabled()) source.logger.error(source.getRowColumnVector(pos).appendTo(new StringBuilder(200).append("EndTag ").append(name).append(" at ")).append(" not recognised as type '").append(getDescription()).append("' because its name and closing delimiter are separated by characters other than white space").toString()); return null;
if (startTag.name.equals(searchName)) return startTag; if (startTag.name.startsWith(searchName) && startTag.isPartialNameSearchMatch(searchName)) return startTag; if (startTag.name.length()<searchName.length() && source.getParseText().containsAt(searchName,startTag.begin+searchStartTagType.startDelimiterPrefix.length())) return startTag; startTag=(StartTag)startTag.getNextTag(searchStartTagType);
if (startTag.name.equals(searchName)) return startTag; if (startTag.name.startsWith(searchName) && startTag.isPartialNameSearchMatch(searchName)) return startTag; if (startTag.name.length()<searchName.length() && source.getParseText().containsAt(searchName,startTag.begin+searchStartTagType.startDelimiterPrefix.length())) return startTag; startTag=(StartTag)startTag.getPreviousTag(searchStartTagType);
if (this==EndTagType.NORMAL && source.getParseText().containsAt("</script",pos)) {