jericho-html-3.1

16:37:25.600 INFO  jd.cli.Main - Decompiling jericho-html-3.1.jar
package net.htmlparser.jericho;

import java.io.IOException;

public final class Attribute
  extends Segment
{
  private final String key;
  private final Segment nameSegment;
  private final Segment valueSegment;
  private final Segment valueSegmentIncludingQuotes;
  static final String CHECKED = "checked";
  static final String CLASS = "class";
  static final String DISABLED = "disabled";
  static final String ID = "id";
  static final String MULTIPLE = "multiple";
  static final String NAME = "name";
  static final String SELECTED = "selected";
  static final String STYLE = "style";
  static final String TYPE = "type";
  static final String VALUE = "value";
  
  Attribute(Source paramSource, String paramString, Segment paramSegment)
  {
    this(paramSource, paramString, paramSegment, null, null);
  }
  
  Attribute(Source paramSource, String paramString, Segment paramSegment1, Segment paramSegment2, Segment paramSegment3)
  {
    super(paramSource, paramSegment1.getBegin(), paramSegment3 == null ? paramSegment1.getEnd() : paramSegment3.getEnd());
    key = paramString;
    nameSegment = paramSegment1;
    valueSegment = paramSegment2;
    valueSegmentIncludingQuotes = paramSegment3;
  }
  
  public String getKey()
  {
    return key;
  }
  
  public String getName()
  {
    return nameSegment.toString();
  }
  
  public Segment getNameSegment()
  {
    return nameSegment;
  }
  
  public boolean hasValue()
  {
    return valueSegment != null;
  }
  
  public String getValue()
  {
    return CharacterReference.decode(valueSegment, true);
  }
  
  public Segment getValueSegment()
  {
    return valueSegment;
  }
  
  public Segment getValueSegmentIncludingQuotes()
  {
    return valueSegmentIncludingQuotes;
  }
  
  public char getQuoteChar()
  {
    if (valueSegment == valueSegmentIncludingQuotes) {
      return ' ';
    }
    return source.charAt(valueSegmentIncludingQuotes.getBegin());
  }
  
  public String getDebugInfo()
  {
    StringBuilder localStringBuilder = new StringBuilder().append(key).append(super.getDebugInfo()).append(",name=").append(nameSegment.getDebugInfo());
    if (hasValue()) {
      localStringBuilder.append(",value=").append(valueSegment.getDebugInfo()).append('"').append(valueSegment).append('"').append(Config.NewLine);
    } else {
      localStringBuilder.append(",NO VALUE").append(Config.NewLine);
    }
    return localStringBuilder.toString();
  }
  
  Tag appendTidy(Appendable paramAppendable, Tag paramTag)
    throws IOException
  {
    paramAppendable.append(' ').append(nameSegment);
    if (valueSegment != null)
    {
      paramAppendable.append("=\"");
      while ((paramTag != null) && (begin < valueSegment.begin)) {
        paramTag = paramTag.getNextTag();
      }
      if ((paramTag == null) || (begin >= valueSegment.end))
      {
        appendTidyValue(paramAppendable, valueSegment);
      }
      else
      {
        int i = valueSegment.begin;
        while ((paramTag != null) && (begin < valueSegment.end))
        {
          appendTidyValue(paramAppendable, new Segment(source, i, begin));
          if (end > valueSegment.end)
          {
            paramAppendable.append(new Segment(source, begin, i = valueSegment.end));
            break;
          }
          paramAppendable.append(paramTag);
          i = end;
          paramTag = paramTag.getNextTag();
        }
        if (i < valueSegment.end) {
          appendTidyValue(paramAppendable, new Segment(source, i, valueSegment.end));
        }
      }
      paramAppendable.append('"');
    }
    return paramTag;
  }
  
  private static void appendTidyValue(Appendable paramAppendable, CharSequence paramCharSequence)
    throws IOException
  {
    CharacterReference.appendEncode(paramAppendable, CharacterReference.decode(paramCharSequence, true), false);
  }
  
  static Appendable appendHTML(Appendable paramAppendable, CharSequence paramCharSequence1, CharSequence paramCharSequence2)
    throws IOException
  {
    paramAppendable.append(' ').append(paramCharSequence1);
    if (paramCharSequence2 != null)
    {
      paramAppendable.append("=\"");
      CharacterReference.appendEncode(paramAppendable, paramCharSequence2, false);
      paramAppendable.append('"');
    }
    return paramAppendable;
  }
}

/* Location:
 * Qualified Name:     net.htmlparser.jericho.Attribute
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package net.htmlparser.jericho;

class Attributes$1
{
  static
  {
    try
    {
      $SwitchMap$net$htmlparser$jericho$Attributes$ParsingState[Attributes.ParsingState.IN_VALUE.ordinal()] = 1;
    }
    catch (NoSuchFieldError localNoSuchFieldError1) {}
    try
    {
      $SwitchMap$net$htmlparser$jericho$Attributes$ParsingState[Attributes.ParsingState.IN_NAME.ordinal()] = 2;
    }
    catch (NoSuchFieldError localNoSuchFieldError2) {}
    try
    {
      $SwitchMap$net$htmlparser$jericho$Attributes$ParsingState[Attributes.ParsingState.AFTER_NAME.ordinal()] = 3;
    }
    catch (NoSuchFieldError localNoSuchFieldError3) {}
    try
    {
      $SwitchMap$net$htmlparser$jericho$Attributes$ParsingState[Attributes.ParsingState.BETWEEN_ATTRIBUTES.ordinal()] = 4;
    }
    catch (NoSuchFieldError localNoSuchFieldError4) {}
    try
    {
      $SwitchMap$net$htmlparser$jericho$Attributes$ParsingState[Attributes.ParsingState.START_VALUE.ordinal()] = 5;
    }
    catch (NoSuchFieldError localNoSuchFieldError5) {}
    try
    {
      $SwitchMap$net$htmlparser$jericho$Attributes$ParsingState[Attributes.ParsingState.AFTER_TAG_NAME.ordinal()] = 6;
    }
    catch (NoSuchFieldError localNoSuchFieldError6) {}
  }
}

/* Location:
 * Qualified Name:     net.htmlparser.jericho.Attributes.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package net.htmlparser.jericho;

 enum Attributes$ParsingState
{
  AFTER_TAG_NAME,  BETWEEN_ATTRIBUTES,  IN_NAME,  AFTER_NAME,  START_VALUE,  IN_VALUE,  AFTER_VALUE_FINAL_QUOTE;
  
  private Attributes$ParsingState() {}
}

/* Location:
 * Qualified Name:     net.htmlparser.jericho.Attributes.ParsingState
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package net.htmlparser.jericho;

import java.io.IOException;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map;
import java.util.Map.Entry;
import net.htmlparser.jericho.nodoc.SequentialListSegment;

public final class Attributes
  extends SequentialListSegment<Attribute>
{
  private final LinkedList<Attribute> attributeList;
  final boolean containsServerTagOutsideOfAttributeValue;
  
  private static enum ParsingState
  {
    AFTER_TAG_NAME,  BETWEEN_ATTRIBUTES,  IN_NAME,  AFTER_NAME,  START_VALUE,  IN_VALUE,  AFTER_VALUE_FINAL_QUOTE;
    
    private ParsingState() {}
  }
  
  private static int defaultMaxErrorCount = 2;
  
  private Attributes(Source paramSource, int paramInt1, int paramInt2, LinkedList<Attribute> paramLinkedList, boolean paramBoolean)
  {
    super(paramSource, paramInt1, paramInt2);
    attributeList = paramLinkedList;
    containsServerTagOutsideOfAttributeValue = paramBoolean;
  }
  
  static Attributes construct(Source paramSource, int paramInt, StartTagType paramStartTagType, String paramString)
  {
    return construct(paramSource, "StartTag", ParsingState.AFTER_TAG_NAME, paramInt, -1, -1, paramStartTagType, paramString, defaultMaxErrorCount);
  }
  
  static Attributes construct(Source paramSource, int paramInt1, int paramInt2, int paramInt3, StartTagType paramStartTagType, String paramString, int paramInt4)
  {
    return construct(paramSource, "Attributes for StartTag", ParsingState.BETWEEN_ATTRIBUTES, paramInt1, paramInt2, paramInt3, paramStartTagType, paramString, paramInt4);
  }
  
  static Attributes construct(Source paramSource, int paramInt1, int paramInt2, int paramInt3)
  {
    return construct(paramSource, "Attributes", ParsingState.BETWEEN_ATTRIBUTES, paramInt1, -1, paramInt2, StartTagType.NORMAL, null, paramInt3);
  }
  
  private static Attributes construct(Source paramSource, String paramString1, ParsingState paramParsingState, int paramInt1, int paramInt2, int paramInt3, StartTagType paramStartTagType, String paramString2, int paramInt4)
  {
    boolean bool1 = false;
    if (paramString2 != null)
    {
      if (paramInt2 == -1) {
        paramInt2 = paramInt1 + 1 + paramString2.length();
      }
      if ((paramStartTagType == StartTagType.NORMAL) && (HTMLElements.isClosingSlashIgnored(paramString2))) {
        bool1 = true;
      }
    }
    else
    {
      paramInt2 = paramInt1;
    }
    int i = paramInt2;
    LinkedList localLinkedList = new LinkedList();
    boolean bool2 = false;
    ParseText localParseText = paramSource.getParseText();
    int j = paramInt2;
    int k = 32;
    Segment localSegment1 = null;
    String str = null;
    int m = -1;
    int n = 0;
    int i1 = 0;
    try
    {
      while (n == 0)
      {
        if ((j == paramInt3) || (paramStartTagType.atEndOfAttributes(paramSource, j, bool1))) {
          n = 1;
        }
        char c = localParseText.charAt(j);
        Object localObject;
        if (c == '<')
        {
          localObject = Tag.getTagAt(paramSource, j, true);
          if (localObject != null)
          {
            if (paramParsingState == ParsingState.START_VALUE)
            {
              m = j;
              k = 32;
              paramParsingState = ParsingState.IN_VALUE;
            }
            j = i = end;
            if (paramParsingState == ParsingState.IN_VALUE) {
              continue;
            }
            bool2 = true; continue;
          }
        }
        switch (paramParsingState)
        {
        case IN_VALUE: 
          if ((n != 0) || (c == k) || ((k == 32) && (isWhiteSpace(c))))
          {
            Segment localSegment2;
            if (k == 32)
            {
              localObject = localSegment2 = new Segment(paramSource, m, j);
            }
            else if (n != 0)
            {
              if (j == paramInt3)
              {
                if (logger.isInfoEnabled()) {
                  log(paramSource, paramString1, paramString2, paramInt1, "terminated in the middle of a quoted attribute value", j);
                }
                i1++;
                if (reachedMaxErrorCount(i1, paramSource, paramString1, paramString2, paramInt1, paramInt4)) {
                  return null;
                }
                localObject = new Segment(paramSource, m, j);
                localSegment2 = new Segment(paramSource, m - 1, j);
              }
              else
              {
                n = 0;
                break;
              }
            }
            else
            {
              localObject = new Segment(paramSource, m, j);
              localSegment2 = new Segment(paramSource, m - 1, j + 1);
            }
            localLinkedList.add(new Attribute(paramSource, str, localSegment1, (Segment)localObject, localSegment2));
            i = localSegment2.getEnd();
            paramParsingState = ParsingState.BETWEEN_ATTRIBUTES;
          }
          else if ((c == '<') && (k == 32))
          {
            if (logger.isInfoEnabled()) {
              log(paramSource, paramString1, paramString2, paramInt1, "rejected because of '<' character in unquoted attribute value", j);
            }
            return null;
          }
          break;
        case IN_NAME: 
          if ((n != 0) || (c == '=') || (isWhiteSpace(c)))
          {
            localSegment1 = new Segment(paramSource, m, j);
            str = localSegment1.toString().toLowerCase();
            if (n != 0)
            {
              localLinkedList.add(new Attribute(paramSource, str, localSegment1));
              i = j;
            }
            else
            {
              paramParsingState = c == '=' ? ParsingState.START_VALUE : ParsingState.AFTER_NAME;
            }
          }
          else if (!Tag.isXMLNameChar(c))
          {
            if (c == '<')
            {
              if (logger.isInfoEnabled()) {
                log(paramSource, paramString1, paramString2, paramInt1, "rejected because of '<' character in attribute name", j);
              }
              return null;
            }
            if (!isInvalidEmptyElementTag(paramStartTagType, paramSource, j, paramString1, paramString2, paramInt1))
            {
              if (logger.isInfoEnabled()) {
                log(paramSource, paramString1, paramString2, paramInt1, "contains attribute name with invalid character", j);
              }
              i1++;
              if (reachedMaxErrorCount(i1, paramSource, paramString1, paramString2, paramInt1, paramInt4)) {
                return null;
              }
            }
          }
          break;
        case AFTER_NAME: 
          if ((n != 0) || ((c != '=') && (!isWhiteSpace(c))))
          {
            localLinkedList.add(new Attribute(paramSource, str, localSegment1));
            i = localSegment1.getEnd();
            if (n == 0)
            {
              paramParsingState = ParsingState.BETWEEN_ATTRIBUTES;
              j--;
            }
          }
          else if (c == '=')
          {
            paramParsingState = ParsingState.START_VALUE;
          }
          else if (c == '<')
          {
            if (logger.isInfoEnabled()) {
              log(paramSource, paramString1, paramString2, paramInt1, "rejected because of '<' character after attribute name", j);
            }
            return null;
          }
          break;
        case BETWEEN_ATTRIBUTES: 
          if (n == 0) {
            if (isWhiteSpace(c))
            {
              k = 32;
            }
            else
            {
              if (k != 32)
              {
                if (logger.isInfoEnabled()) {
                  log(paramSource, paramString1, paramString2, paramInt1, "has missing whitespace after quoted attribute value", j);
                }
                if (i1 > 0)
                {
                  i1++;
                  if (reachedMaxErrorCount(i1, paramSource, paramString1, paramString2, paramInt1, paramInt4)) {
                    return null;
                  }
                }
              }
              if (!Tag.isXMLNameStartChar(c))
              {
                if (c == '<')
                {
                  if (logger.isInfoEnabled()) {
                    log(paramSource, paramString1, paramString2, paramInt1, "rejected because of '<' character", j);
                  }
                  return null;
                }
                if (isInvalidEmptyElementTag(paramStartTagType, paramSource, j, paramString1, paramString2, paramInt1)) {
                  break;
                }
                if ((paramStartTagType == StartTagType.NORMAL) && (paramStartTagType.atEndOfAttributes(paramSource, j, false)))
                {
                  if (!logger.isInfoEnabled()) {
                    break;
                  }
                  log(paramSource, paramString1, paramString2, paramInt1, "contains a '/' character before the closing '>', which is ignored because tags of this name cannot be empty-element tags"); break;
                }
                if (logger.isInfoEnabled()) {
                  log(paramSource, paramString1, paramString2, paramInt1, "contains attribute name with invalid first character", j);
                }
                i1++;
                if (reachedMaxErrorCount(i1, paramSource, paramString1, paramString2, paramInt1, paramInt4)) {
                  return null;
                }
              }
              paramParsingState = ParsingState.IN_NAME;
              m = j;
            }
          }
          break;
        case START_VALUE: 
          m = j;
          if (n != 0)
          {
            if (logger.isInfoEnabled()) {
              log(paramSource, paramString1, paramString2, paramInt1, "has missing attribute value after '=' sign", j);
            }
            if (i1 > 0)
            {
              i1++;
              if (reachedMaxErrorCount(i1, paramSource, paramString1, paramString2, paramInt1, paramInt4)) {
                return null;
              }
            }
            localObject = new Segment(paramSource, j, j);
            localLinkedList.add(new Attribute(paramSource, str, localSegment1, (Segment)localObject, (Segment)localObject));
            i = j;
            paramParsingState = ParsingState.BETWEEN_ATTRIBUTES;
          }
          else
          {
            if ((c == '\'') || (c == '"'))
            {
              k = c;
              m++;
            }
            else
            {
              if (isWhiteSpace(c)) {
                break;
              }
              if (c == '<')
              {
                if (logger.isInfoEnabled()) {
                  log(paramSource, paramString1, paramString2, paramInt1, "rejected because of '<' character at the start of an attribute value", j);
                }
                return null;
              }
              k = 32;
            }
            paramParsingState = ParsingState.IN_VALUE;
          }
          break;
        case AFTER_TAG_NAME: 
          if (n == 0) {
            if (!isWhiteSpace(c))
            {
              if (!isInvalidEmptyElementTag(paramStartTagType, paramSource, j, paramString1, paramString2, paramInt1))
              {
                if (logger.isInfoEnabled()) {
                  log(paramSource, paramString1, paramString2, paramInt1, "rejected because the name contains an invalid character", j);
                }
                return null;
              }
            }
            else {
              paramParsingState = ParsingState.BETWEEN_ATTRIBUTES;
            }
          }
          break;
        }
        j++;
      }
      return new Attributes(paramSource, paramInt2, i, localLinkedList, bool2);
    }
    catch (IndexOutOfBoundsException localIndexOutOfBoundsException)
    {
      if (logger.isInfoEnabled()) {
        log(paramSource, paramString1, paramString2, paramInt1, "rejected because it has no closing '>' character");
      }
    }
    return null;
  }
  
  private static boolean reachedMaxErrorCount(int paramInt1, Source paramSource, String paramString1, String paramString2, int paramInt2, int paramInt3)
  {
    if (paramInt1 <= paramInt3) {
      return false;
    }
    if (logger.isInfoEnabled()) {
      log(paramSource, paramString1, paramString2, paramInt2, "rejected because it contains too many errors");
    }
    return true;
  }
  
  private static boolean isInvalidEmptyElementTag(StartTagType paramStartTagType, Source paramSource, int paramInt1, String paramString1, String paramString2, int paramInt2)
  {
    if ((paramStartTagType != StartTagType.NORMAL) || (!paramStartTagType.atEndOfAttributes(paramSource, paramInt1, false))) {
      return false;
    }
    if (logger.isInfoEnabled()) {
      log(paramSource, paramString1, paramString2, paramInt2, "contains a '/' character before the closing '>', which is ignored because tags of this name cannot be empty-element tags");
    }
    return true;
  }
  
  public Attribute get(String paramString)
  {
    if (size() == 0) {
      return null;
    }
    for (int i = 0; i < size(); i++)
    {
      Attribute localAttribute = (Attribute)get(i);
      if (localAttribute.getKey().equalsIgnoreCase(paramString)) {
        return localAttribute;
      }
    }
    return null;
  }
  
  public String getValue(String paramString)
  {
    Attribute localAttribute = get(paramString);
    return localAttribute == null ? null : localAttribute.getValue();
  }
  
  String getRawValue(String paramString)
  {
    Attribute localAttribute = get(paramString);
    return (localAttribute == null) || (!localAttribute.hasValue()) ? null : localAttribute.getValueSegment().toString();
  }
  
  public int getCount()
  {
    return attributeList.size();
  }
  
  public Iterator<Attribute> iterator()
  {
    return listIterator();
  }
  
  public ListIterator<Attribute> listIterator(int paramInt)
  {
    return attributeList.listIterator(paramInt);
  }
  
  public Map<String, String> populateMap(Map<String, String> paramMap, boolean paramBoolean)
  {
    for (Attribute localAttribute : this) {
      paramMap.put(paramBoolean ? localAttribute.getKey() : localAttribute.getName(), localAttribute.getValue());
    }
    return paramMap;
  }
  
  public String getDebugInfo()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("Attributes ").append(super.getDebugInfo()).append(": ");
    if (isEmpty())
    {
      localStringBuilder.append("EMPTY");
    }
    else
    {
      localStringBuilder.append(Config.NewLine);
      for (Attribute localAttribute : this) {
        localStringBuilder.append("  ").append(localAttribute.getDebugInfo());
      }
    }
    return localStringBuilder.toString();
  }
  
  public static int getDefaultMaxErrorCount()
  {
    return defaultMaxErrorCount;
  }
  
  public static void setDefaultMaxErrorCount(int paramInt)
  {
    defaultMaxErrorCount = paramInt;
  }
  
  public static String generateHTML(Map<String, String> paramMap)
  {
    StringBuilder localStringBuilder = new StringBuilder();
    try
    {
      appendHTML(localStringBuilder, paramMap);
    }
    catch (IOException localIOException) {}
    return localStringBuilder.toString();
  }
  
  static void appendHTML(Appendable paramAppendable, Map<String, String> paramMap)
    throws IOException
  {
    for (Map.Entry localEntry : paramMap.entrySet()) {
      Attribute.appendHTML(paramAppendable, (CharSequence)localEntry.getKey(), (CharSequence)localEntry.getValue());
    }
  }
  
  Appendable appendTidy(Appendable paramAppendable, Tag paramTag)
    throws IOException
  {
    for (Attribute localAttribute : this) {
      paramTag = localAttribute.appendTidy(paramAppendable, paramTag);
    }
    return paramAppendable;
  }
  
  Map<String, String> getMap(boolean paramBoolean)
  {
    return populateMap(new LinkedHashMap(getCount() * 2, 1.0F), paramBoolean);
  }
  
  private static void log(Source paramSource, String paramString1, CharSequence paramCharSequence, int paramInt1, String paramString2, int paramInt2)
  {
    logger.info(paramSource.getRowColumnVector(paramInt2).appendTo(paramSource.getRowColumnVector(paramInt1).appendTo(new StringBuilder(200).append(paramString1).append(' ').append(paramCharSequence).append(" at ")).append(' ').append(paramString2).append(" at position ")).toString());
  }
  
  private static void log(Source paramSource, String paramString1, CharSequence paramCharSequence, int paramInt, String paramString2)
  {
    logger.info(' ' + paramString2);
  }
}

/* Location:
 * Qualified Name:     net.htmlparser.jericho.Attributes
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package net.htmlparser.jericho;

import java.io.IOException;
import java.io.Writer;
import java.util.Map;

class AttributesOutputSegment
  implements OutputSegment
{
  private final int begin;
  private final int end;
  private final Map<String, String> map;
  
  public AttributesOutputSegment(Attributes paramAttributes, boolean paramBoolean)
  {
    this(paramAttributes, paramAttributes.getMap(paramBoolean));
  }
  
  public AttributesOutputSegment(Attributes paramAttributes, Map<String, String> paramMap)
  {
    if ((paramMap == null) || (paramAttributes == null)) {
      throw new IllegalArgumentException("both arguments must be non-null");
    }
    begin = paramAttributes.getBegin();
    end = paramAttributes.getEnd();
    map = paramMap;
  }
  
  public int getBegin()
  {
    return begin;
  }
  
  public int getEnd()
  {
    return end;
  }
  
  public Map<String, String> getMap()
  {
    return map;
  }
  
  public void writeTo(Writer paramWriter)
    throws IOException
  {
    Attributes.appendHTML(paramWriter, map);
  }
  
  public void appendTo(Appendable paramAppendable)
    throws IOException
  {
    Attributes.appendHTML(paramAppendable, map);
  }
  
  public long getEstimatedMaximumOutputLength()
  {
    return (end - begin) * 2;
  }
  
  public String toString()
  {
    return Attributes.generateHTML(map);
  }
  
  public String getDebugInfo()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("(p").append(begin).append("-p").append(end).append("):");
    try
    {
      appendTo(localStringBuilder);
    }
    catch (IOException localIOException)
    {
      throw new RuntimeException(localIOException);
    }
    return localStringBuilder.toString();
  }
}

/* Location:
 * Qualified Name:     net.htmlparser.jericho.AttributesOutputSegment
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package net.htmlparser.jericho;

import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;

public class BasicLogFormatter
  extends Formatter
{
  public static boolean OutputLevel = true;
  public static boolean OutputName = false;
  static final Formatter INSTANCE = new BasicLogFormatter();
  
  public String format(LogRecord paramLogRecord)
  {
    return format(paramLogRecord.getLevel().getName(), paramLogRecord.getMessage(), paramLogRecord.getLoggerName());
  }
  
  public static String format(String paramString1, String paramString2, String paramString3)
  {
    StringBuilder localStringBuilder = new StringBuilder(paramString2.length() + 40);
    if (OutputLevel) {
      localStringBuilder.append(paramString1).append(": ");
    }
    if ((OutputName) && (paramString3 != null)) {
      localStringBuilder.append('[').append(paramString3).append("] ");
    }
    localStringBuilder.append(paramString2);
    localStringBuilder.append(Config.NewLine);
    return localStringBuilder.toString();
  }
}

/* Location:
 * Qualified Name:     net.htmlparser.jericho.BasicLogFormatter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package net.htmlparser.jericho;

import java.io.IOException;
import java.io.Writer;

final class BlankOutputSegment
  implements OutputSegment
{
  private final int begin;
  private final int end;
  
  public BlankOutputSegment(int paramInt1, int paramInt2)
  {
    begin = paramInt1;
    end = paramInt2;
  }
  
  public BlankOutputSegment(Segment paramSegment)
  {
    this(paramSegment.getBegin(), paramSegment.getEnd());
  }
  
  public int getBegin()
  {
    return begin;
  }
  
  public int getEnd()
  {
    return end;
  }
  
  public void writeTo(Writer paramWriter)
    throws IOException
  {
    appendTo(paramWriter);
  }
  
  public void appendTo(Appendable paramAppendable)
    throws IOException
  {
    for (int i = begin; i < end; i++) {
      paramAppendable.append(' ');
    }
  }
  
  public long getEstimatedMaximumOutputLength()
  {
    return end - begin;
  }
  
  public String toString()
  {
    StringBuilder localStringBuilder = new StringBuilder(end - begin);
    for (int i = begin; i < end; i++) {
      localStringBuilder.append(' ');
    }
    return localStringBuilder.toString();
  }
  
  public String getDebugInfo()
  {
    return "Replace with Spaces: (p" + begin + "-p" + end + ')';
  }
}

/* Location:
 * Qualified Name:     net.htmlparser.jericho.BlankOutputSegment
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package net.htmlparser.jericho;

import java.util.Iterator;
import java.util.List;

final class Cache
{
  public final Source source;
  private final SubCache allTagTypesSubCache;
  private final SubCache[] subCaches;
  static final Cache STREAMED_SOURCE_MARKER = new Cache();
  
  public Cache(Source paramSource)
  {
    source = paramSource;
    allTagTypesSubCache = new SubCache(this, null);
    TagType[] arrayOfTagType = getSeparatelyCachedTagTypes();
    subCaches = new SubCache[arrayOfTagType.length + 1];
    subCaches[0] = allTagTypesSubCache;
    for (int i = 0; i < arrayOfTagType.length; i++) {
      subCaches[(i + 1)] = new SubCache(this, arrayOfTagType[i]);
    }
  }
  
  private Cache()
  {
    source = null;
    allTagTypesSubCache = null;
    subCaches = null;
  }
  
  public void clear()
  {
    for (Iterator localIterator = allTagTypesSubCache.getTagIterator(); localIterator.hasNext(); ((Tag)localIterator.next()).orphan()) {}
    for (int i = 0; i < subCaches.length; i++) {
      subCaches[i].clear();
    }
  }
  
  public Tag getTagAt(int paramInt, boolean paramBoolean)
  {
    return source.useAllTypesCache ? allTagTypesSubCache.getTagAt(paramInt, paramBoolean) : Tag.getTagAtUncached(source, paramInt, paramBoolean);
  }
  
  public Tag getPreviousTag(int paramInt)
  {
    return allTagTypesSubCache.getPreviousTag(paramInt);
  }
  
  public Tag getNextTag(int paramInt)
  {
    return allTagTypesSubCache.getNextTag(paramInt);
  }
  
  public Tag getPreviousTag(int paramInt, TagType paramTagType)
  {
    for (int i = source.useAllTypesCache ? 0 : 1; i < subCaches.length; i++) {
      if (paramTagType == subCaches[i].tagType) {
        return subCaches[i].getPreviousTag(paramInt);
      }
    }
    return Tag.getPreviousTagUncached(source, paramInt, paramTagType, -1);
  }
  
  public Tag getNextTag(int paramInt, TagType paramTagType)
  {
    for (int i = source.useAllTypesCache ? 0 : 1; i < subCaches.length; i++) {
      if (paramTagType == subCaches[i].tagType) {
        return subCaches[i].getNextTag(paramInt);
      }
    }
    return Tag.getNextTagUncached(source, paramInt, paramTagType, -1);
  }
  
  public Tag addTagAt(int paramInt, boolean paramBoolean)
  {
    Tag localTag = Tag.getTagAtUncached(source, paramInt, paramBoolean);
    if ((paramBoolean) && (localTag == null)) {
      return null;
    }
    allTagTypesSubCache.addTagAt(paramInt, localTag);
    if (localTag == null) {
      return null;
    }
    TagType localTagType = localTag.getTagType();
    for (int i = 1; i < subCaches.length; i++) {
      if (localTagType == subCaches[i].tagType)
      {
        subCaches[i].addTagAt(paramInt, localTag);
        return localTag;
      }
    }
    return localTag;
  }
  
  public int getTagCount()
  {
    return allTagTypesSubCache.size() - 2;
  }
  
  public Iterator<Tag> getTagIterator()
  {
    return allTagTypesSubCache.getTagIterator();
  }
  
  public void loadAllTags(List<Tag> paramList, Tag[] paramArrayOfTag, StartTag[] paramArrayOfStartTag)
  {
    int i = paramList.size();
    allTagTypesSubCache.bulkLoad_Init(i);
    int j = 0;
    int k = 0;
    for (int m = 0; m < i; m++)
    {
      Tag localTag = (Tag)paramList.get(m);
      if (!localTag.isUnregistered())
      {
        paramArrayOfTag[(j++)] = localTag;
        if ((localTag instanceof StartTag)) {
          paramArrayOfStartTag[(k++)] = ((StartTag)localTag);
        }
      }
      allTagTypesSubCache.bulkLoad_Set(m, localTag);
      for (int n = 1; n < subCaches.length; n++) {
        if (localTag.getTagType() == subCaches[n].tagType)
        {
          subCaches[n].bulkLoad_AddToTypeSpecificCache(localTag);
          break;
        }
      }
    }
    for (m = 1; m < subCaches.length; m++) {
      subCaches[m].bulkLoad_FinaliseTypeSpecificCache();
    }
  }
  
  public String toString()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    for (int i = 0; i < subCaches.length; i++) {
      subCaches[i].appendTo(localStringBuilder);
    }
    return localStringBuilder.toString();
  }
  
  protected int getSourceLength()
  {
    return source.end;
  }
  
  private static TagType[] getSeparatelyCachedTagTypes()
  {
    return TagType.getTagTypesIgnoringEnclosedMarkup();
  }
}

/* Location:
 * Qualified Name:     net.htmlparser.jericho.Cache
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package net.htmlparser.jericho;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

public class CharacterEntityReference
  extends CharacterReference
{
  private String name;
  public static final char _nbsp = '�';
  public static final char _iexcl = '�';
  public static final char _cent = '�';
  public static final char _pound = '�';
  public static final char _curren = '�';
  public static final char _yen = '�';
  public static final char _brvbar = '�';
  public static final char _sect = '�';
  public static final char _uml = '�';
  public static final char _copy = '�';
  public static final char _ordf = '�';
  public static final char _laquo = '�';
  public static final char _not = '�';
  public static final char _shy = '�';
  public static final char _reg = '�';
  public static final char _macr = '�';
  public static final char _deg = '�';
  public static final char _plusmn = '�';
  public static final char _sup2 = '�';
  public static final char _sup3 = '�';
  public static final char _acute = '�';
  public static final char _micro = '�';
  public static final char _para = '�';
  public static final char _middot = '�';
  public static final char _cedil = '�';
  public static final char _sup1 = '�';
  public static final char _ordm = '�';
  public static final char _raquo = '�';
  public static final char _frac14 = '�';
  public static final char _frac12 = '�';
  public static final char _frac34 = '�';
  public static final char _iquest = '�';
  public static final char _Agrave = '�';
  public static final char _Aacute = '�';
  public static final char _Acirc = '�';
  public static final char _Atilde = '�';
  public static final char _Auml = '�';
  public static final char _Aring = '�';
  public static final char _AElig = '�';
  public static final char _Ccedil = '�';
  public static final char _Egrave = '�';
  public static final char _Eacute = '�';
  public static final char _Ecirc = '�';
  public static final char _Euml = '�';
  public static final char _Igrave = '�';
  public static final char _Iacute = '�';
  public static final char _Icirc = '�';
  public static final char _Iuml = '�';
  public static final char _ETH = '�';
  public static final char _Ntilde = '�';
  public static final char _Ograve = '�';
  public static final char _Oacute = '�';
  public static final char _Ocirc = '�';
  public static final char _Otilde = '�';
  public static final char _Ouml = '�';
  public static final char _times = '�';
  public static final char _Oslash = '�';
  public static final char _Ugrave = '�';
  public static final char _Uacute = '�';
  public static final char _Ucirc = '�';
  public static final char _Uuml = '�';
  public static final char _Yacute = '�';
  public static final char _THORN = '�';
  public static final char _szlig = '�';
  public static final char _agrave = '�';
  public static final char _aacute = '�';
  public static final char _acirc = '�';
  public static final char _atilde = '�';
  public static final char _auml = '�';
  public static final char _aring = '�';
  public static final char _aelig = '�';
  public static final char _ccedil = '�';
  public static final char _egrave = '�';
  public static final char _eacute = '�';
  public static final char _ecirc = '�';
  public static final char _euml = '�';
  public static final char _igrave = '�';
  public static final char _iacute = '�';
  public static final char _icirc = '�';
  public static final char _iuml = '�';
  public static final char _eth = '�';
  public static final char _ntilde = '�';
  public static final char _ograve = '�';
  public static final char _oacute = '�';
  public static final char _ocirc = '�';
  public static final char _otilde = '�';
  public static final char _ouml = '�';
  public static final char _divide = '�';
  public static final char _oslash = '�';
  public static final char _ugrave = '�';
  public static final char _uacute = '�';
  public static final char _ucirc = '�';
  public static final char _uuml = '�';
  public static final char _yacute = '�';
  public static final char _thorn = '�';
  public static final char _yuml = '�';
  public static final char _fnof = '�';
  public static final char _Alpha = '?';
  public static final char _Beta = '?';
  public static final char _Gamma = '?';
  public static final char _Delta = '?';
  public static final char _Epsilon = '?';
  public static final char _Zeta = '?';
  public static final char _Eta = '?';
  public static final char _Theta = '?';
  public static final char _Iota = '?';
  public static final char _Kappa = '?';
  public static final char _Lambda = '?';
  public static final char _Mu = '?';
  public static final char _Nu = '?';
  public static final char _Xi = '?';
  public static final char _Omicron = '?';
  public static final char _Pi = '?';
  public static final char _Rho = '?';
  public static final char _Sigma = '?';
  public static final char _Tau = '?';
  public static final char _Upsilon = '?';
  public static final char _Phi = '?';
  public static final char _Chi = '?';
  public static final char _Psi = '?';
  public static final char _Omega = '?';
  public static final char _alpha = '?';
  public static final char _beta = '?';
  public static final char _gamma = '?';
  public static final char _delta = '?';
  public static final char _epsilon = '?';
  public static final char _zeta = '?';
  public static final char _eta = '?';
  public static final char _theta = '?';
  public static final char _iota = '?';
  public static final char _kappa = '?';
  public static final char _lambda = '?';
  public static final char _mu = '?';
  public static final char _nu = '?';
  public static final char _xi = '?';
  public static final char _omicron = '?';
  public static final char _pi = '?';
  public static final char _rho = '?';
  public static final char _sigmaf = '?';
  public static final char _sigma = '?';
  public static final char _tau = '?';
  public static final char _upsilon = '?';
  public static final char _phi = '?';
  public static final char _chi = '?';
  public static final char _psi = '?';
  public static final char _omega = '?';
  public static final char _thetasym = '?';
  public static final char _upsih = '?';
  public static final char _piv = '?';
  public static final char _bull = '�';
  public static final char _hellip = '�';
  public static final char _prime = '?';
  public static final char _Prime = '?';
  public static final char _oline = '?';
  public static final char _frasl = '?';
  public static final char _weierp = '?';
  public static final char _image = '?';
  public static final char _real = '?';
  public static final char _trade = '�';
  public static final char _alefsym = '?';
  public static final char _larr = '?';
  public static final char _uarr = '?';
  public static final char _rarr = '?';
  public static final char _darr = '?';
  public static final char _harr = '?';
  public static final char _crarr = '?';
  public static final char _lArr = '?';
  public static final char _uArr = '?';
  public static final char _rArr = '?';
  public static final char _dArr = '?';
  public static final char _hArr = '?';
  public static final char _forall = '?';
  public static final char _part = '?';
  public static final char _exist = '?';
  public static final char _empty = '?';
  public static final char _nabla = '?';
  public static final char _isin = '?';
  public static final char _notin = '?';
  public static final char _ni = '?';
  public static final char _prod = '?';
  public static final char _sum = '?';
  public static final char _minus = '?';
  public static final char _lowast = '?';
  public static final char _radic = '?';
  public static final char _prop = '?';
  public static final char _infin = '?';
  public static final char _ang = '?';
  public static final char _and = '?';
  public static final char _or = '?';
  public static final char _cap = '?';
  public static final char _cup = '?';
  public static final char _int = '?';
  public static final char _there4 = '?';
  public static final char _sim = '?';
  public static final char _cong = '?';
  public static final char _
1 2 3 4 5 6 7 8 9 10 11 12 13

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd