org.eclipse.mylyn.wikitext.core_1.6.1.v20120425-0100

 String paramString2, String paramString3);
  
  public abstract void writeAttribute(String paramString1, String paramString2, String paramString3, String paramString4);
  
  public abstract void writeCData(String paramString);
  
  public abstract void writeCharacters(String paramString);
  
  public abstract void writeCharacters(char[] paramArrayOfChar, int paramInt1, int paramInt2);
  
  public abstract void writeComment(String paramString);
  
  public abstract void writeDTD(String paramString);
  
  public abstract void writeDefaultNamespace(String paramString);
  
  public abstract void writeEmptyElement(String paramString);
  
  public abstract void writeEmptyElement(String paramString1, String paramString2);
  
  public abstract void writeEmptyElement(String paramString1, String paramString2, String paramString3);
  
  public abstract void writeEndDocument();
  
  public abstract void writeEndElement();
  
  public abstract void writeEntityRef(String paramString);
  
  public abstract void writeNamespace(String paramString1, String paramString2);
  
  public abstract void writeProcessingInstruction(String paramString);
  
  public abstract void writeProcessingInstruction(String paramString1, String paramString2);
  
  public abstract void writeStartDocument();
  
  public abstract void writeStartDocument(String paramString);
  
  public abstract void writeStartDocument(String paramString1, String paramString2);
  
  public abstract void writeStartElement(String paramString);
  
  public abstract void writeStartElement(String paramString1, String paramString2);
  
  public abstract void writeStartElement(String paramString1, String paramString2, String paramString3);
  
  public abstract void writeLiteral(String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.util.XmlStreamWriter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.util;

import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import java.util.Stack;
import org.eclipse.mylyn.internal.wikitext.core.util.XML11Char;

public class DefaultXmlStreamWriter
  extends XmlStreamWriter
{
  private PrintWriter out;
  private final Map<String, String> prefixToUri = new HashMap();
  private final Map<String, String> uriToPrefix = new HashMap();
  private boolean inEmptyElement = false;
  private boolean inStartElement = false;
  private final Stack<String> elements = new Stack();
  private char xmlHederQuoteChar = '\'';
  
  public DefaultXmlStreamWriter(OutputStream out)
    throws UnsupportedEncodingException
  {
    this.out = createUtf8PrintWriter(out);
  }
  
  public DefaultXmlStreamWriter(Writer out)
  {
    this.out = new PrintWriter(out);
  }
  
  public DefaultXmlStreamWriter(Writer out, char xmlHeaderQuoteChar)
  {
    this.out = new PrintWriter(out);
    xmlHederQuoteChar = xmlHeaderQuoteChar;
  }
  
  protected PrintWriter createUtf8PrintWriter(OutputStream out)
    throws UnsupportedEncodingException
  {
    return new PrintWriter(new OutputStreamWriter(out, "UTF8"));
  }
  
  public void close()
  {
    if (out != null)
    {
      closeElement();
      flush();
    }
    out = null;
  }
  
  public void flush()
  {
    out.flush();
  }
  
  public String getPrefix(String uri)
  {
    return (String)uriToPrefix.get(uri);
  }
  
  public Object getProperty(String name)
    throws IllegalArgumentException
  {
    return null;
  }
  
  public void setDefaultNamespace(String uri)
  {
    setPrefix("", uri);
  }
  
  public void setPrefix(String prefix, String uri)
  {
    prefixToUri.put(prefix, uri);
    uriToPrefix.put(uri, prefix);
  }
  
  public void writeAttribute(String localName, String value)
  {
    out.write(32);
    out.write(localName);
    out.write("=\"");
    if (value != null) {
      attrEncode(value);
    }
    out.write("\"");
  }
  
  public void writeAttribute(String namespaceURI, String localName, String value)
  {
    out.write(32);
    String prefix = (String)uriToPrefix.get(namespaceURI);
    if ((prefix != null) && (prefix.length() > 0))
    {
      out.write(prefix);
      out.write(58);
    }
    out.write(localName);
    out.write("=\"");
    if (value != null) {
      attrEncode(value);
    }
    out.write("\"");
  }
  
  public void writeAttribute(String prefix, String namespaceURI, String localName, String value)
  {
    out.write(32);
    if ((prefix != null) && (prefix.length() > 0))
    {
      out.write(prefix);
      out.write(58);
    }
    out.write(localName);
    out.write("=\"");
    if (value != null) {
      attrEncode(value);
    }
    out.write("\"");
  }
  
  private void attrEncode(String value)
  {
    if (value == null) {
      return;
    }
    printEscaped(out, value, true);
  }
  
  private void encode(String text)
  {
    if (text == null) {
      return;
    }
    printEscaped(out, text, false);
  }
  
  public void writeCData(String data)
  {
    closeElement();
    out.write("<![CDATA[");
    out.write(data);
    out.write("]]>");
  }
  
  public void writeCharacters(String text)
  {
    closeElement();
    encode(text);
  }
  
  public void writeCharactersUnescaped(String text)
  {
    closeElement();
    out.print(text);
  }
  
  public void writeLiteral(String literal)
  {
    writeCharactersUnescaped(literal);
  }
  
  public void writeCharacters(char[] text, int start, int len)
  {
    closeElement();
    encode(new String(text, start, len));
  }
  
  public void writeComment(String data)
  {
    closeElement();
    out.write("<!-- ");
    out.write(data);
    out.write(" -->");
  }
  
  public void writeDTD(String dtd)
  {
    out.write(dtd);
  }
  
  public void writeDefaultNamespace(String namespaceURI)
  {
    writeAttribute("xmlns", namespaceURI);
  }
  
  private void closeElement()
  {
    if (inEmptyElement)
    {
      out.write("/>");
      inEmptyElement = false;
    }
    else if (inStartElement)
    {
      out.write(">");
      inStartElement = false;
    }
  }
  
  public void writeEmptyElement(String localName)
  {
    closeElement();
    inEmptyElement = true;
    out.write(60);
    out.write(localName);
  }
  
  public void writeEmptyElement(String namespaceURI, String localName)
  {
    closeElement();
    inEmptyElement = true;
    String prefix = (String)uriToPrefix.get(namespaceURI);
    out.write(60);
    if ((prefix != null) && (prefix.length() > 0))
    {
      out.write(prefix);
      out.write(58);
    }
    out.write(localName);
  }
  
  public void writeEmptyElement(String prefix, String localName, String namespaceURI)
  {
    closeElement();
    inEmptyElement = true;
    out.write(60);
    if ((prefix != null) && (prefix.length() > 0))
    {
      out.write(prefix);
      out.write(58);
    }
    out.write(localName);
  }
  
  public void writeEndDocument()
  {
    if (!elements.isEmpty()) {
      throw new IllegalStateException(elements.size() + " elements not closed");
    }
  }
  
  public void writeEndElement()
  {
    closeElement();
    if (elements.isEmpty()) {
      throw new IllegalStateException();
    }
    String name = (String)elements.pop();
    out.write(60);
    out.write(47);
    out.write(name);
    out.write(62);
  }
  
  public void writeEntityRef(String name)
  {
    closeElement();
    out.write(38);
    out.write(name);
    out.write(59);
  }
  
  public void writeNamespace(String prefix, String namespaceURI)
  {
    if ((prefix == null) || (prefix.length() == 0)) {
      writeAttribute("xmlns", namespaceURI);
    } else {
      writeAttribute("xmlns:" + prefix, namespaceURI);
    }
  }
  
  public void writeProcessingInstruction(String target)
  {
    closeElement();
  }
  
  public void writeProcessingInstruction(String target, String data)
  {
    closeElement();
  }
  
  public void writeStartDocument()
  {
    out.write(processXmlHeader("<?xml version='1.0' ?>"));
  }
  
  public void writeStartDocument(String version)
  {
    out.write(processXmlHeader("<?xml version='" + version + "' ?>"));
  }
  
  public void writeStartDocument(String encoding, String version)
  {
    out.write(processXmlHeader("<?xml version='" + version + "' encoding='" + encoding + "' ?>"));
  }
  
  public void writeStartElement(String localName)
  {
    closeElement();
    inStartElement = true;
    elements.push(localName);
    out.write(60);
    out.write(localName);
  }
  
  public void writeStartElement(String namespaceURI, String localName)
  {
    closeElement();
    inStartElement = true;
    String prefix = (String)uriToPrefix.get(namespaceURI);
    out.write(60);
    if ((prefix != null) && (prefix.length() > 0))
    {
      out.write(prefix);
      out.write(58);
      elements.push(prefix + ':' + localName);
    }
    else
    {
      elements.push(localName);
    }
    out.write(localName);
  }
  
  public void writeStartElement(String prefix, String localName, String namespaceURI)
  {
    closeElement();
    inStartElement = true;
    elements.push(localName);
    out.write(60);
    if ((prefix != null) && (prefix.length() > 0))
    {
      out.write(prefix);
      out.write(58);
    }
    out.write(localName);
  }
  
  public char getXmlHederQuoteChar()
  {
    return xmlHederQuoteChar;
  }
  
  public void setXmlHederQuoteChar(char xmlHederQuoteChar)
  {
    this.xmlHederQuoteChar = xmlHederQuoteChar;
  }
  
  private String processXmlHeader(String header)
  {
    return xmlHederQuoteChar == '\'' ? header : header.replace('\'', xmlHederQuoteChar);
  }
  
  private static void printEscaped(PrintWriter writer, CharSequence s, boolean attribute)
  {
    int length = s.length();
    try
    {
      for (int x = 0; x < length; x++)
      {
        char ch = s.charAt(x);
        printEscaped(writer, ch, attribute);
      }
    }
    catch (IOException localIOException)
    {
      throw new IllegalStateException();
    }
  }
  
  private static void printEscaped(PrintWriter writer, int ch, boolean attribute)
    throws IOException
  {
    String ref = getEntityRef(ch, attribute);
    if (ref != null)
    {
      writer.write(38);
      writer.write(ref);
      writer.write(59);
    }
    else if ((ch == 13) || (ch == 133) || (ch == 8232))
    {
      printHex(writer, ch);
    }
    else if (((ch >= 32) && (ch != 160) && (isUtf8Printable((char)ch)) && (XML11Char.isXML11ValidLiteral(ch))) || 
      (ch == 9) || (ch == 10) || (ch == 13))
    {
      writer.write((char)ch);
    }
    else
    {
      printHex(writer, ch);
    }
  }
  
  static final void printHex(PrintWriter writer, int ch)
    throws IOException
  {
    writer.write("&#x");
    writer.write(Integer.toHexString(ch));
    writer.write(59);
  }
  
  protected static String getEntityRef(int ch, boolean attribute)
  {
    switch (ch)
    {
    case 60: 
      return "lt";
    case 62: 
      if (!attribute) {
        return "gt";
      }
    case 34: 
      if (attribute) {
        return "quot";
      }
      break;
    case 38: 
      return "amp";
    }
    return null;
  }
  
  protected static boolean isUtf8Printable(char ch)
  {
    if (((ch >= ' ') && (ch <= 1114111) && (ch != '�')) || (ch == '\n') || (ch == '\r') || (ch == '\t')) {
      return true;
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.util.DefaultXmlStreamWriter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.util;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

class Messages
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.wikitext.core.util.messages";
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("org.eclipse.mylyn.wikitext.core.util.messages");
  
  public static String getString(String key)
  {
    try
    {
      return RESOURCE_BUNDLE.getString(key);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + key + '!';
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.util.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core;

abstract interface package-info {}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.package-info
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.validation;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;

public class MarkupValidator
{
  private final List<ValidationRule> rules = new ArrayList();
  
  public List<ValidationProblem> validate(IProgressMonitor monitor, String markup)
  {
    return validate(monitor, markup, 0, markup.length());
  }
  
  public List<ValidationProblem> validate(IProgressMonitor monitor, String markup, int offset, int length)
  {
    int totalWork = (length == 0) || (rules.isEmpty()) ? 1 : rules.size();
    monitor.beginTask(Messages.getString("MarkupValidator.0"), totalWork);
    try
    {
      Object localObject2;
      if ((length == 0) || (rules.isEmpty())) {
        return Collections.emptyList();
      }
      List<ValidationProblem> problems = new ArrayList();
      for (ValidationRule rule : rules)
      {
        problems.addAll(rule.findProblems(markup, offset, length));
        monitor.worked(1);
      }
      if (!problems.isEmpty()) {
        Collections.sort(problems);
      }
      return problems;
    }
    finally
    {
      monitor.done();
    }
  }
  
  public List<ValidationRule> getRules()
  {
    return rules;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.validation.MarkupValidator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.validation;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.mylyn.wikitext.core.parser.Attributes;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.SpanType;
import org.eclipse.mylyn.wikitext.core.parser.IdGenerator;
import org.eclipse.mylyn.wikitext.core.parser.LinkAttributes;
import org.eclipse.mylyn.wikitext.core.parser.Locator;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineParser;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineParser.OutlineBuilder;

final class DocumentLocalReferenceValidationRule$OutlineParserExtension
  extends OutlineParser
{
  public IdGenerator idGenerator;
  private final int offset;
  private final int length;
  private List<DocumentLocalReferenceValidationRule.LocalReference> references;
  
  private DocumentLocalReferenceValidationRule$OutlineParserExtension(DocumentLocalReferenceValidationRule paramDocumentLocalReferenceValidationRule, int offset, int length)
  {
    this.offset = offset;
    this.length = length;
  }
  
  private final class OutlineBuilderExtension
    extends OutlineParser.OutlineBuilder
  {
    private OutlineBuilderExtension(OutlineItem root, int labelMaxLength)
    {
      super(root, labelMaxLength);
      idGenerator = idGenerator;
    }
    
    public void beginSpan(DocumentBuilder.SpanType type, Attributes attributes)
    {
      super.beginSpan(type, attributes);
      if ((type == DocumentBuilder.SpanType.LINK) && 
        ((attributes instanceof LinkAttributes)))
      {
        LinkAttributes linkAttributes = (LinkAttributes)attributes;
        processLink(getLocator(), linkAttributes.getHref());
      }
    }
    
    public void link(Attributes attributes, String hrefOrHashName, String text)
    {
      super.link(attributes, hrefOrHashName, text);
      processLink(getLocator(), hrefOrHashName);
    }
    
    public void imageLink(Attributes linkAttributes, Attributes ImageAttributes, String href, String imageUrl)
    {
      super.imageLink(linkAttributes, ImageAttributes, href, imageUrl);
      processLink(getLocator(), href);
    }
  }
  
  protected boolean isBlocksOnly()
  {
    return false;
  }
  
  public DocumentBuilder createOutlineUpdater(OutlineItem rootItem)
  {
    return new OutlineBuilderExtension(rootItem, getLabelMaxLength(), null);
  }
  
  public void processLink(Locator locator, String href)
  {
    if ((locator.getDocumentOffset() < offset) || (locator.getDocumentOffset() >= offset + this.length)) {
      return;
    }
    if ((href.length() > 0) && (href.charAt(0) == '#'))
    {
      if (references == null) {
        references = new ArrayList();
      }
      String name = href.substring(1);
      int length = locator.getLineSegmentEndOffset() - locator.getLineCharacterOffset();
      references.add(new DocumentLocalReferenceValidationRule.LocalReference(this$0, name, locator.getDocumentOffset(), length));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.validation.DocumentLocalReferenceValidationRule.OutlineParserExtension
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.validation;

public enum ValidationProblem$Severity
{
  WARNING,  ERROR;
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.validation.ValidationProblem.Severity
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.validation;

abstract interface package-info {}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.validation.package-info
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.validation;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.eclipse.mylyn.wikitext.core.parser.Attributes;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.SpanType;
import org.eclipse.mylyn.wikitext.core.parser.IdGenerator;
import org.eclipse.mylyn.wikitext.core.parser.LinkAttributes;
import org.eclipse.mylyn.wikitext.core.parser.Locator;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineParser;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineParser.OutlineBuilder;

public abstract class DocumentLocalReferenceValidationRule
  extends ValidationRule
{
  protected abstract MarkupLanguage createMarkupLanguage();
  
  private final class LocalReference
  {
    String name;
    int offset;
    int length;
    
    public LocalReference(String name, int offset, int length)
    {
      this.name = name;
      this.offset = offset;
      this.length = length;
      if (length < 0) {
        throw new IllegalArgumentException();
      }
    }
  }
  
  private final class OutlineParserExtension
    extends OutlineParser
  {
    public IdGenerator idGenerator;
    private final int offset;
    private final int length;
    private List<DocumentLocalReferenceValidationRule.LocalReference> references;
    
    private OutlineParserExtension(int offset, int length)
    {
      this.offset = offset;
      this.length = length;
    }
    
    private final class OutlineBuilderExtension
      extends OutlineParser.OutlineBuilder
    {
      private OutlineBuilderExtension(OutlineItem root, int labelMaxLength)
      {
        super(root, labelMaxLength);
        idGenerator = idGenerator;
      }
      
      public void beginSpan(DocumentBuilder.SpanType type, Attributes attributes)
      {
        super.beginSpan(type, attributes);
        if ((type == DocumentBuilder.SpanType.LINK) && 
          ((attributes instanceof LinkAttributes)))
        {
          LinkAttributes linkAttributes = (LinkAttributes)attributes;
          processLink(getLocator(), linkAttributes.getHref());
        }
      }
      
      public void link(Attributes attributes, String hrefOrHashName, String text)
      {
        super.link(attributes, hrefOrHashName, text);
        processLink(getLocator(), hrefOrHashName);
      }
      
      public void imageLink(Attributes linkAttributes, Attributes ImageAttributes, String href, String imageUrl)
      {
        super.imageLink(linkAttributes, ImageAttributes, href, imageUrl);
        processLink(getLocator(), href);
      }
    }
    
    protected boolean isBlocksOnly()
    {
      return false;
    }
    
    public DocumentBuilder createOutlineUpdater(OutlineItem rootItem)
    {
      return new OutlineBuilderExtension(rootItem, getLabelMaxLength(), null);
    }
    
    public void processLink(Locator locator, String href)
    {
      if ((locator.getDocumentOffset() < offset) || (locator.getDocumentOffset() >= offset + this.length)) {
        return;
      }
      if ((href.length() > 0) && (href.charAt(0) == '#'))
      {
        if (references == null) {
          references = new ArrayList();
        }
        String name = href.substring(1);
        int length = locator.getLineSegmentEndOffset() - locator.getLineCharacterOffset();
        references.add(new DocumentLocalReferenceValidationRule.LocalReference(DocumentLocalReferenceValidationRule.this, name, locator.getDocumentOffset(), length));
      }
    }
  }
  
  public ValidationProblem findProblem(String markup, int offset, int length)
  {
    throw new UnsupportedOperationException();
  }
  
  public List<ValidationProblem> findProblems(String markup, int offset, int length)
  {
    MarkupLanguage markupLanguage = createMarkupLanguage();
    
    OutlineParserExtension outlineParser = new OutlineParserExtension(offset, length, null);
    outlineParser.setMarkupLanguage(markupLanguage);
    outlineParser.parse(markup);
    
    List<ValidationProblem> problems = null;
    if (references != null)
    {
      Set<String> anchorNames = idGenerator.getAnchorNames();
      for (LocalReference reference : references) {
        if (!anchorNames.contains(name))
        {
          if (problems == null) {
            problems = new ArrayList();
          }
          problems.add(new ValidationProblem(
            ValidationProblem.Severity.ERROR, 
            MessageFormat.format(
            Messages.getString("DocumentLocalReferenceValidationRule.0"), new Object[] { name }), offset, 
            length));
        }
      }
    }
    if (problems == null) {
      return Collections.emptyList();
    }
    return problems;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.validation.DocumentLocalReferenceValidationRule
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.validation;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public abstract class ValidationRule
{
  public abstract ValidationProblem findProblem(String paramString, int paramInt1, int paramInt2);
  
  public List<ValidationProblem> findProblems(String markup, int offset, int length)
  {
    if (length == 0) {
      return Collections.emptyList();
    }
    int end = offset + length;
    if (end > markup.length()) {
      end = markup.length();
    }
    List<ValidationProblem> problems = new ArrayList();
    
    int o = offset;
    while (o < end)
    {
      ValidationProblem problem = findProblem(markup, o, length - (o - offset));
      if (problem == null) {
        break;
      }
      problems.add(problem);
      int newO = problem.getOffset() + problem.getLength();
      if (newO <= o) {
        break;
      }
      o = newO;
    }
    return problems;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.validation.ValidationRule
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.validation;

import org.eclipse.mylyn.wikitext.core.parser.Attributes;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.SpanType;
import org.eclipse.mylyn.wikitext.core.parser.LinkAttributes;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineParser.OutlineBuilder;

final class DocumentLocalReferenceValidationRule$OutlineParserExtension$OutlineBuilderExtension
  extends OutlineParser.OutlineBuilder
{
  private DocumentLocalReferenceValidationRule$OutlineParserExtension$OutlineBuilderExtension(DocumentLocalReferenceValidationRule.OutlineParserExtension paramOutlineParserExtension, OutlineItem root, int labelMaxLength)
  {
    super(paramOutlineParserExtension, root, labelMaxLength);
    idGenerator = idGenerator;
  }
  
  public void beginSpan(DocumentBuilder.SpanType type, Attributes attributes)
  {
    super.beginSpan(type, attributes);
    if ((type == DocumentBuilder.SpanType.LINK) && 
      ((attributes instanceof LinkAttributes)))
    {
      LinkAttributes linkAttributes = (LinkAttributes)attributes;
      this$1.processLink(getLocator(), linkAttributes.getHref());
    }
  }
  
  public void link(Attributes attributes, String hrefOrHashName, String text)
  {
    super.link(attributes, hrefOrHashName, text);
    this$1.processLink(getLocator(), hrefOrHashName);
  }
  
  public void imageLink(Attributes linkAttributes, Attributes ImageAttributes, String href, String imageUrl)
  {
    super.imageLink(linkAttributes, ImageAttributes, href, imageUrl);
    this$1.processLink(getLocator(), href);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.validation.DocumentLocalReferenceValidationRule.OutlineParserExtension.OutlineBuilderExtension
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.validation;

public class ValidationProblem
  implements Comparable<ValidationProblem>
{
  public static final String DEFAULT_MARKER_ID = "org.eclipse.mylyn.wikitext.core.validation.problem";
  
  public static enum Severity
  {
    WARNING,  ERROR;
  }
  
  private String markerId = "org.eclipse.mylyn.wikitext.core.validation.problem";
  private Severity severity;
  private String message;
  private int offset;
  private int length;
  
  public ValidationProblem(Severity severity, String message, int offset, int length)
  {
    setSeverity(severity);
    setMessage(message);
    setOffset(offset);
    setLength(length);
  }
  
  public String getMarkerId()
  {
    return markerId;
  }
  
  public void setMarkerId(String markerId)
  {
    this.markerId = markerId;
  }
  
  public Severity getSeverity()
  {
    return severity;
  }
  
  public void setSeverity(Severity severity)
  {
    if (severity == null) {
      throw new IllegalArgumentException();
    }
    this.severity = severity;
  }
  
  public String getMessage()
  {
    return message;
  }
  
  public void setMessage(String message)
  {
    if ((message == null) || (message.length() == 0)) {
      throw new IllegalArgumentException();
    }
    this.message = message;
  }
  
  public int getOffset()
  {
    return offset;
  }
  
  public void setOffset(int offset)
  {
    if (offset < 0) {
      throw new IllegalArgumentException();
    }
    this.offset = offset;
  }
  
  public int getLength()
  {
    return length;
  }
  
  public void setLength(int length)
  {
    if (length < 0) {
      throw new IllegalArgumentException();
    }
    this.length = length;
  }
  
  public String toString()
  {
    return severity + "[" + offset + "," + length + "]: " + message;
  }
  
  public int compareTo(ValidationProblem o2)
  {
    if (this == o2) {
      return 0;
    }
    int offset1 = getOffset();
    int offset2 = o2.getOffset();
    if (offset1 < offset2) {
      return -1;
    }
    if (offset2 < offset1) {
      return 1;
    }
    int length1 = getLength();
    int length2 = o2.getLength();
    if (length1 > length2) {
      return -1;
    }
    if (length2 > length1) {
      return 1;
    }
    int i = getMessage().compareTo(o2.getMessage());
    if (i == 0) {
      i = getMarkerId().compareTo(o2.getMarkerId());
    }
    return i;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.validation.ValidationProblem
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.validation;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

class Messages
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.wikitext.core.validation.messages";
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("org.eclipse.mylyn.wikitext.core.validation.messages");
  
  public static String getString(String key)
  {
    try
    {
      return RESOURCE_BUNDLE.getString(key);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + key + '!';
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.validation.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.validation;

final class DocumentLocalReferenceValidationRule$LocalReference
{
  String name;
  int offset;
  int length;
  
  public DocumentLocalReferenceValidationRule$LocalReference(DocumentLocalReferenceValidationRule paramDocumentLocalReferenceValidationRule, String name, int offset, int length)
  {
    this.name = name;
    this.offset = offset;
    this.length = length;
    if (length < 0) {
      throw new IllegalArgumentException();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.validation.DocumentLocalReferenceValidationRule.LocalReference
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.parser;

public enum DocumentBuilder$SpanType
{
  EMPHASIS,  STRONG,  ITALIC,  BOLD,  CITATION,  DELETED,  INSERTED,  SUPERSCRIPT,  SUBSCRIPT,  SPAN,  CODE,  MONOSPACE,  UNDERLINED,  QUOTE,  LINK;
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.SpanType
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.parser.util;

public abstract interface Matcher
{
  public abstract String group(int paramInt);
  
  public abstract int start(int paramInt);
  
  public abstract int end(int paramInt);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.parser.util.Matcher
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.parser.util;

import java.io.Writer;
import org.eclipse.mylyn.wikitext.core.parser.builder.DocBookDocumentBuilder;
import org.eclipse.mylyn.wikitext.core.util.XmlStreamWriter;

class MarkupToDocbook$1
  extends DocBookDocumentBuilder
{
  MarkupToDocbook$1(MarkupToDocbook paramMarkupToDocbook, Writer $anonymous0)
  {
    super($anonymous0);
  }
  
  protected XmlStreamWriter createXmlStreamWriter(Writer out)
  {
    return super.createFormattingXmlStreamWriter(out);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.parser.util.MarkupToDocbook.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.parser.util;

import java.io.StringWriter;
import java.io.Writer;
import java.util.List;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineParser;
import org.eclipse.mylyn.wikitext.core.util.DefaultXmlStreamWriter;
import org.eclipse.mylyn.wikitext.core.util.FormattingXMLStreamWriter;
import org.eclipse.mylyn.wikitext.core.util.XmlStreamWriter;

public class MarkupToEclipseToc
{
  private String bookTitle;
  private String htmlFile;
  private MarkupLanguage markupLanguage;
  private String helpPrefix;
  
  public String parse(String markupContent)
  {
    if (markupLanguage == null) {
      throw new IllegalStateException("Must set markupLanguage");
    }
    OutlineParser parser = new OutlineParser(markupLanguage);
    
    OutlineItem root = parser.parse(markupContent);
    
    return createToc(root);
  }
  
  public String createToc(OutlineItem root)
  {
    StringWriter out = new StringWriter(8096);
    
    XmlStreamWriter writer = createXmlStreamWriter(out);
    
    writer.writeStartDocument("utf-8", "1.0");
    
    writer.writeStartElement("toc");
    writer.writeAttribute("topic", adjustForPrefix(getHtmlFile()));
    writer.writeAttribute("label", getBookTitle());
    
    emitToc(writer, root.getChildren());
    
    writer.writeEndElement();
    
    writer.writeEndDocument();
    writer.close();
    
    return out.toString();
  }
  
  private void emitToc(XmlStreamWriter writer, List<OutlineItem> children)
  {
    for (OutlineItem item : children)
    {
      writer.writeStartElement("topic");
      
      String file = computeFile(item);
      
      file = adjustForPrefix(file);
      
      String suffix = "";
      
      OutlineItem previous = item.getPrevious();
      if ((previous != null) && (previous.getParent() != null))
      {
        String fileOfPrevious = computeFile(previous);
        fileOfPrevious = adjustForPrefix(fileOfPrevious);
        if (file.equals(fileOfPrevious)) {
          suffix = "#" + item.getId();
        }
      }
      writer.writeAttribute("href", file + suffix);
      writer.writeAttribute("label", item.getLabel());
      if (!item.getChildren().isEmpty()) {
        emitToc(writer, item.getChildren());
      }
      writer.writeEndElement();
    }
  }
  
  private String adjustForPrefix(String file)
  {
    if (helpPrefix != null) {
      if (helpPrefix.endsWith("/")) {
        file = helpPrefix + file;
      } else {
        file = helpPrefix + '/' + file;
      }
    }
    return file;
  }
  
  protected String computeFile(OutlineItem item)
  {
    return getHtmlFile();
  }
  
  public MarkupLanguage getMarkupLanguage()
  {
    return markupLanguage;
  }
  
  public void setMarkupLanguage(MarkupLanguage markupLanguage)
  {
    this.markupLanguage = markupLanguage;
  }
  
  public String getBookTitle()
  {
    return bookTitle;
  }
  
  public void setBookTitle(String bookTitle)
  {
    this.bookTitle = bookTitle;
  }
  
  public String getHtmlFile()
  {
    return htmlFile;
  }
  
  public void setHtmlFile(String htmlFile)
  {
    this.htmlFile = htmlFile;
  }
  
  protected XmlStreamWriter createXmlStreamWriter(Writer out)
  {
    XmlStreamWriter writer = new DefaultXmlStreamWriter(out);
    return new FormattingXMLStreamWriter(writer);
  }
  
  public void setHelpPrefix(String helpPrefix)
  {
    this.helpPrefix = helpPrefix;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.parser.util.MarkupToEclipseToc
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.parser.util;

abstract interface package-info {}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.parser.util.package-info
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.parser.util;

import java.io.StringWriter;
import java.io.Writer;
import org.eclipse.mylyn.wikitext.core.parser.MarkupParser;
import org.eclipse.mylyn.wikitext.core.parser.builder.DocBookDocumentBuilder;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;
import org.eclipse.mylyn.wikitext.core.util.XmlStreamWriter;

public class MarkupToDocbook
{
  private String bookTitle;
  private MarkupLanguage markupLanguage;
  
  public MarkupLanguage getMarkupLanguage()
  {
    return markupLanguage;
  }
  
  public void setMarkupLanguage(MarkupLanguage markupLanguage)
  {
    this.markupLanguage = markupLanguage;
  }
  
  public String parse(String markupContent)
    throws Exception
  {
    if (markupLanguage == null) {
      throw new IllegalStateException("must set markupLanguage");
    }
    StringWriter out = new StringWriter();
    
    DocBookDocumentBuilder builder = new DocBookDocumentBuilder(out)
    {
      protected XmlStreamWriter createXmlStreamWriter(Writer out)
      {
        return super.createFormattingXmlStreamWriter(out);
      }
    };
    builder.setBookTitle(bookTitle);
    
    MarkupParser markupParser = new MarkupParser();
    
    markupParser.setBuilder(builder);
    markupParser.setMarkupLanguage(markupLanguage);
    
    markupParser.parse(markupContent);
    
    return out.toString();
  }
  
  public String getBookTitle()
  {
    return bookTitle;
  }
  
  public void setBookTitle(String bookTitle)
  {
    this.bookTitle = bookTitle;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.parser.util.MarkupToDocbook
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.parser.util;

public class MatcherAdaper
  implements Matcher
{
  private final java.util.regex.Matcher delegate;
  
  public MatcherAdaper(java.util.regex.Matcher delegate)
  {
    this.delegate = delegate;
  }
  
  public int end(int group)
  {
    return delegate.end(group);
  }
  
  public String group(int group)
  {
    return delegate.group(group);
  }
  
  public int start(int group)
  {
    return delegate.start(group);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.parser.util.MatcherAdaper
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.parser;

public class TableCellAttributes
  extends Attributes
{
  private String bgcolor;
  private String align;
  private String valign;
  private String rowspan;
  private String colspan;
  
  public String getBgcolor()
  {
    return bgcolor;
  }
  
  public void setBgcolor(String bgcolor)
  {
    this.bgcolor = bgcolor;
  }
  
  public String getAlign()
  {
    return align;
  }
  
  public void setAlign(String align)
  {
    this.align = align;
  }
  
  public String getValign()
  {
    return valign;
  }
  
  public void setValign(String valign)
  {
    this.valign = valign;
  }
  
  public String getRowspan()
  {
    return rowspan;
  }
  
  public void setRowspan(String rowspan)
  {
    this.rowspan = rowspan;
  }
  
  public String getColspan()
  {
    return colspan;
  }
  
  public void setColspan(String colspan)
  {
    this.colspan = colspan;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.parser.TableCellAttributes
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.wikitext.core.parser;

import java.io.IOException;
import java.io.Reader;
import java.io.StringWriter;
import org.eclipse.mylyn.wikitext.core.parser.builder.HtmlDocumentBuilder;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;

public class MarkupParser
{
  private MarkupLanguage markupLanguage;
  private DocumentBuilder builder;
  
  public MarkupParser() {}
  
  public MarkupParser(MarkupLanguage markupLanaguage, DocumentBuilder builder)
  {
    markupLanguage = markupLanaguage;
    this.builder = builder;
  }
  
  public MarkupParser(MarkupLanguage markupLanaguage)
  {
    markupLanguage = markupLanaguage;
  }
  
  public MarkupLanguage getMarkupLanguage()
  {
    return markupLanguage;
  }
  
  public void setMarkupLanguage(MarkupLanguage markupLanaguage)
  {
    markupLanguage = markupLanaguage;
  }
  
  public DocumentBuilder getBuilder()
  {
    return builder;
  }
  
  public void setBuilder(DocumentBuilder builder)
  {
    this.builder = builder;
  }
  
  public void parse(Reader markupContent)
    throws IOException
  {
    parse(markupContent, true);
  }
  
  public void parse(Reader markupContent, boolean asDocument)
    throws IOException
  {
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

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-2019. Infinite Loop Ltd