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

arkupContent;
  }
  
  public String getFootnoteId(String footnote)
  {
    String id = (String)footnoteIdToHtmlId.get(footnote);
    if (id == null)
    {
      id = "___fn" + footnote;
      footnoteIdToHtmlId.put(footnote, id);
    }
    return id;
  }
  
  public void addGlossaryTerm(String term, String definition)
  {
    String previousDef = (String)glossaryItems.put(term, definition);
    if ((previousDef != null) && (previousDef.length() > definition.length())) {
      glossaryItems.put(term, previousDef);
    }
  }
  
  public Map<String, String> getGlossaryTerms()
  {
    return glossaryItems;
  }
  
  public IdGenerator getIdGenerator()
  {
    return idGenerator;
  }
  
  public int getLineNumber()
  {
    return lineNumber;
  }
  
  protected void setLineNumber(int lineNumber)
  {
    this.lineNumber = lineNumber;
  }
  
  public int getLineOffset()
  {
    return lineOffset;
  }
  
  protected void setLineOffset(int lineOffset)
  {
    this.lineOffset = lineOffset;
  }
  
  public int getLineDocumentOffset()
  {
    return lineOffset;
  }
  
  public int getLineCharacterOffset()
  {
    return lineCharacterOffset;
  }
  
  public void setLineCharacterOffset(int lineCharacterOffset)
  {
    this.lineCharacterOffset = lineCharacterOffset;
  }
  
  public int getDocumentOffset()
  {
    return lineOffset + lineCharacterOffset;
  }
  
  public int getLineLength()
  {
    return lineLength;
  }
  
  public void setLineLength(int lineLength)
  {
    this.lineLength = lineLength;
  }
  
  public void setLineSegmentEndOffset(int lineSegmentEndOffset)
  {
    this.lineSegmentEndOffset = lineSegmentEndOffset;
  }
  
  public int getLineSegmentEndOffset()
  {
    return lineSegmentEndOffset;
  }
  
  void setShift(int shift)
  {
    this.shift = shift;
  }
  
  int getShift()
  {
    return shift;
  }
}

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

public abstract class PatternBasedElement
  implements Cloneable
{
  protected abstract String getPattern(int paramInt);
  
  protected abstract int getPatternGroupCount();
  
  protected abstract PatternBasedElementProcessor newProcessor();
  
  public PatternBasedElement clone()
  {
    try
    {
      return (PatternBasedElement)super.clone();
    }
    catch (CloneNotSupportedException localCloneNotSupportedException)
    {
      throw new IllegalStateException();
    }
  }
}

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

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Stack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public final class MarkupLanguage$PatternBasedSyntax
{
  protected List<PatternBasedElement> elements = new ArrayList();
  protected Pattern elementPattern;
  protected List<Integer> elementGroup = new ArrayList();
  private final StringBuilder patternBuffer = new StringBuilder();
  private int patternGroup = 0;
  private final Stack<MarkupLanguage.Group> groups = new Stack();
  
  public MarkupLanguage$PatternBasedSyntax()
  {
    groups.push(new MarkupLanguage.Group(null));
  }
  
  public void add(PatternBasedElement element)
  {
    elementPattern = null;
    elements.add(element);
    if (groups.peek()).count++ > 0) {
      patternBuffer.append('|');
    }
    patternGroup += 1;
    patternBuffer.append('(');
    patternBuffer.append(element.getPattern(patternGroup));
    patternBuffer.append(')');
    elementGroup.add(Integer.valueOf(patternGroup));
    patternGroup += element.getPatternGroupCount();
  }
  
  protected List<PatternBasedElement> getElements()
  {
    return Collections.unmodifiableList(elements);
  }
  
  public void beginGroup(String regexFragment, int size)
  {
    add(regexFragment, size, true);
  }
  
  public void endGroup(String regexFragment, int size)
  {
    add(regexFragment, size, false);
  }
  
  private void add(String regexFragment, int size, boolean beginGroup)
  {
    elementPattern = null;
    if (beginGroup)
    {
      if (groups.peek()).count++ > 0) {
        patternBuffer.append('|');
      }
      groups.push(new MarkupLanguage.Group(null));
      patternBuffer.append("(?:");
    }
    else
    {
      groups.pop();
    }
    patternBuffer.append(regexFragment);
    if (!beginGroup) {
      patternBuffer.append(")");
    }
    patternGroup += size;
  }
  
  public PatternBasedElementProcessor findPatternBasedElement(String lineText, int offset)
  {
    Matcher matcher = getPattern().matcher(lineText);
    if (offset > 0) {
      matcher.region(offset, lineText.length());
    }
    if (matcher.find())
    {
      int size = elementGroup.size();
      for (int x = 0; x < size; x++)
      {
        int group = ((Integer)elementGroup.get(x)).intValue();
        String value = matcher.group(group);
        if (value != null)
        {
          PatternBasedElement element = (PatternBasedElement)elements.get(x);
          PatternBasedElementProcessor processor = element.newProcessor();
          processor.setLineStartOffset(matcher.start());
          processor.setLineEndOffset(matcher.end());
          processor.setGroup(0, matcher.group(0), matcher.start(0), matcher.end(0));
          for (int y = 0; y < element.getPatternGroupCount(); y++)
          {
            int groupIndex = group + y + 1;
            processor.setGroup(y + 1, matcher.group(groupIndex), matcher.start(groupIndex), 
              matcher.end(groupIndex));
          }
          return processor;
        }
      }
      throw new IllegalStateException();
    }
    return null;
  }
  
  public Pattern getPattern()
  {
    if (elementPattern == null) {
      if (patternBuffer.length() > 0) {
        elementPattern = Pattern.compile(patternBuffer.toString());
      } else {
        return null;
      }
    }
    return elementPattern;
  }
  
  public void clear()
  {
    elements.clear();
    elementPattern = null;
    elementGroup.clear();
    patternBuffer.delete(0, patternBuffer.length());
    patternGroup = 0;
    groups.clear();
    groups.push(new MarkupLanguage.Group(null));
  }
}

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

abstract interface package-info {}

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

class PatternBasedElementProcessor$Group
{
  private final String text;
  private final int start;
  private final int end;
  
  public PatternBasedElementProcessor$Group(String text, int start, int end)
  {
    this.text = text;
    this.start = start;
    this.end = end;
  }
}

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

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class MarkupLanguageConfiguration
  implements Cloneable
{
  private List<Block> blocks = new ArrayList();
  private List<PatternBasedElement> phraseModifiers = new ArrayList();
  private List<PatternBasedElement> tokens = new ArrayList();
  private boolean escapingHtmlAndXml = false;
  private boolean enableUnwrappedParagraphs = true;
  private boolean newlinesMustCauseLineBreak = false;
  private boolean optimizeForRepositoryUsage = false;
  private Boolean wikiWordLinking = Boolean.valueOf(true);
  private Locale locale;
  
  public List<PatternBasedElement> getTokens()
  {
    return tokens;
  }
  
  public List<PatternBasedElement> getPhraseModifiers()
  {
    return phraseModifiers;
  }
  
  public List<Block> getBlocks()
  {
    return blocks;
  }
  
  public boolean isParagraphBreaking(Block block)
  {
    return true;
  }
  
  public boolean isEscapingHtmlAndXml()
  {
    return escapingHtmlAndXml;
  }
  
  public void setEscapingHtmlAndXml(boolean escapingHtmlAndXml)
  {
    this.escapingHtmlAndXml = escapingHtmlAndXml;
  }
  
  public boolean isEnableUnwrappedParagraphs()
  {
    return enableUnwrappedParagraphs;
  }
  
  public void setEnableUnwrappedParagraphs(boolean enableUnwrappedParagraphs)
  {
    this.enableUnwrappedParagraphs = enableUnwrappedParagraphs;
  }
  
  public boolean isNewlinesMustCauseLineBreak()
  {
    return newlinesMustCauseLineBreak;
  }
  
  public void setNewlinesMustCauseLineBreak(boolean newlinesMustCauseLineBreak)
  {
    this.newlinesMustCauseLineBreak = newlinesMustCauseLineBreak;
  }
  
  public void addPhraseModifierExtensions(MarkupLanguage.PatternBasedSyntax phraseModifierSyntax)
  {
    for (PatternBasedElement element : getPhraseModifiers()) {
      phraseModifierSyntax.add(element);
    }
  }
  
  public boolean isOptimizeForRepositoryUsage()
  {
    return optimizeForRepositoryUsage;
  }
  
  public void setOptimizeForRepositoryUsage(boolean optimizeForRepositoryUsage)
  {
    this.optimizeForRepositoryUsage = optimizeForRepositoryUsage;
  }
  
  public Boolean isWikiWordLinking()
  {
    return wikiWordLinking;
  }
  
  public void setWikiWordLinking(Boolean wikiWordLinking)
  {
    this.wikiWordLinking = wikiWordLinking;
  }
  
  public Locale getLocale()
  {
    return locale;
  }
  
  public void setLocale(Locale locale)
  {
    this.locale = locale;
  }
  
  public void addBlockExtensions(List<Block> blocks, List<Block> paragraphBreakingBlocks)
  {
    for (Block block : getBlocks())
    {
      blocks.add(computeInsertPosition(block), block);
      if (isParagraphBreaking(block)) {
        paragraphBreakingBlocks.add(block);
      }
    }
  }
  
  protected int computeInsertPosition(Block block)
  {
    return 0;
  }
  
  public void addTokenExtensions(MarkupLanguage.PatternBasedSyntax tokenSyntax)
  {
    for (PatternBasedElement element : getPhraseModifiers()) {
      tokenSyntax.add(element);
    }
  }
  
  public MarkupLanguageConfiguration clone()
  {
    try
    {
      MarkupLanguageConfiguration copy = (MarkupLanguageConfiguration)super.clone();
      blocks = new ArrayList(blocks.size());
      for (Block block : blocks) {
        blocks.add(block.clone());
      }
      phraseModifiers = new ArrayList(phraseModifiers.size());
      for (PatternBasedElement element : phraseModifiers) {
        phraseModifiers.add(element.clone());
      }
      tokens = new ArrayList(tokens.size());
      for (PatternBasedElement element : tokens) {
        tokens.add(element.clone());
      }
      return copy;
    }
    catch (CloneNotSupportedException e)
    {
      throw new IllegalStateException(e);
    }
  }
}

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

import java.util.HashMap;
import java.util.Map;
import org.eclipse.mylyn.wikitext.core.parser.util.Matcher;

public abstract class PatternBasedElementProcessor
  extends Processor
  implements Matcher
{
  protected int lineStartOffset;
  protected int lineEndOffset;
  protected Map<Integer, Group> groupByIndex;
  
  private static class Group
  {
    private final String text;
    private final int start;
    private final int end;
    
    public Group(String text, int start, int end)
    {
      this.text = text;
      this.start = start;
      this.end = end;
    }
  }
  
  public void setGroup(int group, String capturedText, int start, int end)
  {
    if (groupByIndex == null) {
      groupByIndex = new HashMap();
    }
    groupByIndex.put(Integer.valueOf(group), new Group(capturedText, start, end));
  }
  
  public int getLineStartOffset()
  {
    return lineStartOffset;
  }
  
  public void setLineStartOffset(int lineStartOffset)
  {
    this.lineStartOffset = lineStartOffset;
  }
  
  public int getLineEndOffset()
  {
    return lineEndOffset;
  }
  
  public void setLineEndOffset(int lineEndOffset)
  {
    this.lineEndOffset = lineEndOffset;
  }
  
  public String group(int groupNumber)
  {
    if (groupByIndex == null) {
      return null;
    }
    Group group = (Group)groupByIndex.get(Integer.valueOf(groupNumber));
    return group == null ? null : text;
  }
  
  public int start(int groupNumber)
  {
    if (groupByIndex == null) {
      return -1;
    }
    Group group = (Group)groupByIndex.get(Integer.valueOf(groupNumber));
    return group == null ? -1 : start;
  }
  
  public int end(int groupNumber)
  {
    if (groupByIndex == null) {
      return -1;
    }
    Group group = (Group)groupByIndex.get(Integer.valueOf(groupNumber));
    return group == null ? -1 : end;
  }
  
  public abstract void emit();
}

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

import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder;
import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElementProcessor;

public class LiteralPhraseModifierProcessor
  extends PatternBasedElementProcessor
{
  private final boolean escaping;
  private final int group;
  
  public LiteralPhraseModifierProcessor(boolean escaping)
  {
    this(escaping, 1);
  }
  
  public LiteralPhraseModifierProcessor(boolean escaping, int group)
  {
    this.escaping = escaping;
    this.group = group;
  }
  
  public void emit()
  {
    if (escaping) {
      getBuilder().characters(group(group));
    } else {
      getBuilder().charactersUnescaped(group(group));
    }
  }
}

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

import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElement;
import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElementProcessor;

public class LimitedHtmlStartTagPhraseModifier
  extends PatternBasedElement
{
  private final String pattern;
  
  public LimitedHtmlStartTagPhraseModifier(String... elementNames)
  {
    StringBuilder buf = new StringBuilder();
    buf.append("(<");
    buf.append("(?:");
    int index = 0;
    String[] arrayOfString;
    int j = (arrayOfString = elementNames).length;
    for (int i = 0; i < j; i++)
    {
      String elementName = arrayOfString[i];
      if (index++ > 0) {
        buf.append("|");
      }
      buf.append(elementName);
    }
    buf.append(")(?:\\s*[a-zA-Z][a-zA-Z0-9_:-]*=\"[^\"]*\")*\\s*/?>)");
    pattern = buf.toString();
  }
  
  protected String getPattern(int groupOffset)
  {
    return pattern;
  }
  
  protected PatternBasedElementProcessor newProcessor()
  {
    return new LiteralPhraseModifierProcessor(false);
  }
  
  protected int getPatternGroupCount()
  {
    return 1;
  }
}

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

abstract interface package-info {}

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

import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElement;
import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElementProcessor;

public class LimitedHtmlEndTagPhraseModifier
  extends PatternBasedElement
{
  private final String pattern;
  
  public LimitedHtmlEndTagPhraseModifier(String... elementNames)
  {
    StringBuilder buf = new StringBuilder();
    buf.append("(</");
    buf.append("(?:");
    int index = 0;
    String[] arrayOfString;
    int j = (arrayOfString = elementNames).length;
    for (int i = 0; i < j; i++)
    {
      String elementName = arrayOfString[i];
      if (index++ > 0) {
        buf.append("|");
      }
      buf.append(elementName);
    }
    buf.append(")\\s*>)");
    pattern = buf.toString();
  }
  
  protected String getPattern(int groupOffset)
  {
    return pattern;
  }
  
  protected PatternBasedElementProcessor newProcessor()
  {
    return new LiteralPhraseModifierProcessor(false);
  }
  
  protected int getPatternGroupCount()
  {
    return 1;
  }
}

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

import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElement;
import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElementProcessor;

public class HtmlStartTagPhraseModifier
  extends PatternBasedElement
{
  private final boolean escaping;
  
  public HtmlStartTagPhraseModifier()
  {
    this(false);
  }
  
  public HtmlStartTagPhraseModifier(boolean escaping)
  {
    this.escaping = escaping;
  }
  
  protected String getPattern(int groupOffset)
  {
    return "(<[a-zA-Z][a-zA-Z0-9_:-]*(?:\\s*[a-zA-Z][a-zA-Z0-9_:-]*=\"[^\"]*\")*\\s*/?>)";
  }
  
  protected PatternBasedElementProcessor newProcessor()
  {
    return new LiteralPhraseModifierProcessor(escaping);
  }
  
  protected int getPatternGroupCount()
  {
    return 1;
  }
}

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

import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElement;
import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElementProcessor;

public class HtmlCommentPhraseModifier
  extends PatternBasedElement
{
  protected String getPattern(int groupOffset)
  {
    return "(<!--|-->)";
  }
  
  protected PatternBasedElementProcessor newProcessor()
  {
    return new LiteralPhraseModifierProcessor(false);
  }
  
  protected int getPatternGroupCount()
  {
    return 1;
  }
}

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

import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElement;
import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElementProcessor;

public class HtmlEndTagPhraseModifier
  extends PatternBasedElement
{
  private final boolean escaping;
  
  public HtmlEndTagPhraseModifier()
  {
    this(false);
  }
  
  public HtmlEndTagPhraseModifier(boolean escaping)
  {
    this.escaping = escaping;
  }
  
  protected String getPattern(int groupOffset)
  {
    return "(</[a-zA-Z][a-zA-Z0-9_:-]*\\s*>)";
  }
  
  protected PatternBasedElementProcessor newProcessor()
  {
    return new LiteralPhraseModifierProcessor(escaping);
  }
  
  protected int getPatternGroupCount()
  {
    return 1;
  }
}

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

class MarkupLanguage$LineState
{
  int lineOffset;
  String line;
  
  public MarkupLanguage$LineState(String line, int offset)
  {
    this.line = line;
    lineOffset = offset;
  }
}

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

public class DefaultIdGenerationStrategy
  extends IdGenerationStrategy
{
  public String generateId(String headingText)
  {
    String anchor = headingText.replaceAll("[^a-zA-Z0-9.]", "");
    if ((anchor.length() > 0) && (Character.isDigit(anchor.charAt(0)))) {
      anchor = 'a' + anchor;
    }
    return anchor;
  }
}

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

import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder;
import org.eclipse.mylyn.wikitext.core.parser.MarkupParser;

public class Processor
  implements Cloneable
{
  protected MarkupLanguage markupLanguage;
  protected DocumentBuilder builder;
  protected MarkupParser parser;
  protected ContentState state;
  
  public DocumentBuilder getBuilder()
  {
    return builder;
  }
  
  public MarkupParser getParser()
  {
    return parser;
  }
  
  public void setParser(MarkupParser parser)
  {
    if ((parser != null) && (parser.getMarkupLanguage() != markupLanguage)) {
      if (markupLanguage == null) {
        markupLanguage = parser.getMarkupLanguage();
      } else {
        throw new IllegalStateException();
      }
    }
    this.parser = parser;
    builder = (parser == null ? null : parser.getBuilder());
  }
  
  void setMarkupLanguage(MarkupLanguage markupLanguage)
  {
    this.markupLanguage = markupLanguage;
  }
  
  public MarkupLanguage getMarkupLanguage()
  {
    return markupLanguage;
  }
  
  public ContentState getState()
  {
    return state;
  }
  
  public void setState(ContentState state)
  {
    this.state = state;
  }
  
  public Processor clone()
  {
    try
    {
      Processor copy = (Processor)super.clone();
      parser = null;
      state = null;
      builder = null;
      markupLanguage = null;
      return copy;
    }
    catch (CloneNotSupportedException e)
    {
      throw new IllegalStateException(e);
    }
  }
}

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

import java.util.List;
import java.util.Locale;
import org.eclipse.mylyn.wikitext.core.parser.markup.block.EclipseErrorDetailsBlock;
import org.eclipse.mylyn.wikitext.core.parser.markup.block.JavaStackTraceBlock;

public class ConfigurationBuilder
{
  private final MarkupLanguageConfiguration configuration = new MarkupLanguageConfiguration();
  
  public static ConfigurationBuilder create()
  {
    return new ConfigurationBuilder();
  }
  
  public ConfigurationBuilder repositorySettings()
  {
    ConfigurationBuilder builder = create();
    builder.disableUnwrappedParagraphs()
      .escapingHtmlAndXml()
      .newlinesMustCauseLineBreak()
      .optimizeForRepositoryUsage()
      .block(new EclipseErrorDetailsBlock())
      .block(new JavaStackTraceBlock());
    return builder;
  }
  
  public MarkupLanguageConfiguration configuration()
  {
    return configuration.clone();
  }
  
  public ConfigurationBuilder escapingHtmlAndXml()
  {
    configuration.setEscapingHtmlAndXml(true);
    return this;
  }
  
  public ConfigurationBuilder newlinesMustCauseLineBreak()
  {
    configuration.setNewlinesMustCauseLineBreak(true);
    return this;
  }
  
  public ConfigurationBuilder optimizeForRepositoryUsage()
  {
    configuration.setOptimizeForRepositoryUsage(true);
    return this;
  }
  
  public ConfigurationBuilder disableWikiWordLinking()
  {
    configuration.setWikiWordLinking(Boolean.valueOf(false));
    return this;
  }
  
  public ConfigurationBuilder locale(Locale locale)
  {
    configuration.setLocale(locale);
    return this;
  }
  
  public ConfigurationBuilder disableUnwrappedParagraphs()
  {
    configuration.setEnableUnwrappedParagraphs(false);
    return this;
  }
  
  public ConfigurationBuilder phraseModifier(PatternBasedElement phraseModifier)
  {
    configuration.getPhraseModifiers().add(phraseModifier);
    return this;
  }
  
  public ConfigurationBuilder block(Block block)
  {
    configuration.getBlocks().add(block);
    return this;
  }
  
  public ConfigurationBuilder token(PatternBasedElement tokenSyntax)
  {
    configuration.getTokens().add(tokenSyntax);
    return this;
  }
}

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

class MarkupLanguage$Group
{
  int count;
}

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

import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Stack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder;
import org.eclipse.mylyn.wikitext.core.parser.IdGenerator;
import org.eclipse.mylyn.wikitext.core.parser.MarkupParser;
import org.eclipse.mylyn.wikitext.core.parser.markup.token.ImpliedHyperlinkReplacementToken;

public abstract class MarkupLanguage
  implements Cloneable
{
  private static final DefaultIdGenerationStrategy DEFAULT_ID_GENERATION_STRATEGY = new DefaultIdGenerationStrategy();
  private String name;
  private String extendsLanguage;
  private boolean filterGenerativeBlocks;
  private boolean blocksOnly;
  protected String internalLinkPattern = "{0}";
  private boolean syntaxInitialized = false;
  protected MarkupLanguageConfiguration configuration;
  private boolean enableMacros = true;
  
  public MarkupLanguage clone()
  {
    try
    {
      markupLanguage = (MarkupLanguage)getClass().newInstance();
    }
    catch (Exception e)
    {
      MarkupLanguage markupLanguage;
      throw new IllegalStateException(e);
    }
    MarkupLanguage markupLanguage;
    markupLanguage.setName(name);
    internalLinkPattern = internalLinkPattern;
    enableMacros = enableMacros;
    configuration = (configuration == null ? null : configuration.clone());
    return markupLanguage;
  }
  
  protected ContentState createState()
  {
    ContentState contentState = new ContentState();
    contentState.getIdGenerator().setGenerationStrategy(getIdGenerationStrategy());
    return contentState;
  }
  
  public IdGenerationStrategy getIdGenerationStrategy()
  {
    return DEFAULT_ID_GENERATION_STRATEGY;
  }
  
  /* Error */
  public void processContent(MarkupParser parser, String markupContent, boolean asDocument)
  {
    // Byte code:
    //   0: aload_0
    //   1: iconst_0
    //   2: invokespecial 398	org/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage:initializeSyntax	(Z)V
    //   5: aload_0
    //   6: invokespecial 396	org/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage:initProcessors	()V
    //   9: aload_0
    //   10: invokevirtual 402	org/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage:createState	()Lorg/eclipse/mylyn/wikitext/core/parser/markup/ContentState;
    //   13: astore 4
    //   15: aload 4
    //   17: aload_2
    //   18: invokevirtual 393	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setMarkupContent	(Ljava/lang/String;)V
    //   21: new 194	org/eclipse/mylyn/wikitext/core/util/LocationTrackingReader
    //   24: dup
    //   25: new 166	java/io/StringReader
    //   28: dup
    //   29: aload_2
    //   30: invokespecial 347	java/io/StringReader:<init>	(Ljava/lang/String;)V
    //   33: invokespecial 422	org/eclipse/mylyn/wikitext/core/util/LocationTrackingReader:<init>	(Ljava/io/Reader;)V
    //   36: astore 5
    //   38: aload_1
    //   39: invokevirtual 372	org/eclipse/mylyn/wikitext/core/parser/MarkupParser:getBuilder	()Lorg/eclipse/mylyn/wikitext/core/parser/DocumentBuilder;
    //   42: astore 6
    //   44: aload 6
    //   46: aload 4
    //   48: invokevirtual 370	org/eclipse/mylyn/wikitext/core/parser/DocumentBuilder:setLocator	(Lorg/eclipse/mylyn/wikitext/core/parser/Locator;)V
    //   51: iload_3
    //   52: ifeq +8 -> 60
    //   55: aload 6
    //   57: invokevirtual 367	org/eclipse/mylyn/wikitext/core/parser/DocumentBuilder:beginDocument	()V
    //   60: aconst_null
    //   61: astore 7
    //   63: aconst_null
    //   64: astore 8
    //   66: aconst_null
    //   67: astore 10
    //   69: aload 5
    //   71: invokevirtual 423	org/eclipse/mylyn/wikitext/core/util/LocationTrackingReader:readLine	()Ljava/lang/String;
    //   74: astore 9
    //   76: iconst_0
    //   77: istore 11
    //   79: goto +439 -> 518
    //   82: aload 4
    //   84: aload 5
    //   86: invokevirtual 420	org/eclipse/mylyn/wikitext/core/util/LocationTrackingReader:getLineNumber	()I
    //   89: iconst_1
    //   90: iadd
    //   91: invokevirtual 389	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setLineNumber	(I)V
    //   94: aload 4
    //   96: aload 5
    //   98: invokevirtual 421	org/eclipse/mylyn/wikitext/core/util/LocationTrackingReader:getLineOffset	()I
    //   101: invokevirtual 390	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setLineOffset	(I)V
    //   104: aload 4
    //   106: iload 11
    //   108: invokevirtual 387	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setLineCharacterOffset	(I)V
    //   111: aload 4
    //   113: iconst_0
    //   114: invokevirtual 391	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setLineSegmentEndOffset	(I)V
    //   117: aload 4
    //   119: aload 9
    //   121: invokevirtual 356	java/lang/String:length	()I
    //   124: invokevirtual 388	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setLineLength	(I)V
    //   127: aload 7
    //   129: ifnull +128 -> 257
    //   132: aload 7
    //   134: invokevirtual 363	java/util/Stack:isEmpty	()Z
    //   137: ifne +120 -> 257
    //   140: aload 7
    //   142: invokevirtual 364	java/util/Stack:peek	()Ljava/lang/Object;
    //   145: checkcast 183	org/eclipse/mylyn/wikitext/core/parser/markup/Block
    //   148: astore 12
    //   150: aload 12
    //   152: aload 9
    //   154: iload 11
    //   156: invokevirtual 376	org/eclipse/mylyn/wikitext/core/parser/markup/Block:findCloseOffset	(Ljava/lang/String;I)I
    //   159: istore 13
    //   161: iload 13
    //   163: iconst_m1
    //   164: if_icmpeq +93 -> 257
    //   167: iload 13
    //   169: iload 11
    //   171: if_icmple +51 -> 222
    //   174: aload 9
    //   176: iconst_0
    //   177: iload 13
    //   179: invokevirtual 359	java/lang/String:substring	(II)Ljava/lang/String;
    //   182: astore 14
    //   184: aload 8
    //   186: ifnonnull +12 -> 198
    //   189: new 179	java/util/Stack
    //   192: dup
    //   193: invokespecial 362	java/util/Stack:<init>	()V
    //   196: astore 8
    //   198: aload 8
    //   200: new 188	org/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage$LineState
    //   203: dup
    //   204: aload 9
    //   206: iload 13
    //   208: invokespecial 410	org/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage$LineState:<init>	(Ljava/lang/String;I)V
    //   211: invokevirtual 366	java/util/Stack:push	(Ljava/lang/Object;)Ljava/lang/Object;
    //   214: pop
    //   215: aload 14
    //   217: astore 9
    //   219: goto +38 -> 257
    //   222: aload 10
    //   224: ifnull +12 -> 236
    //   227: aload 10
    //   229: iconst_1
    //   230: invokevirtual 375	org/eclipse/mylyn/wikitext/core/parser/markup/Block:setClosed	(Z)V
    //   233: aconst_null
    //   234: astore 10
    //   236: aload 7
    //   238: invokevirtual 365	java/util/Stack:pop	()Ljava/lang/Object;
    //   241: checkcast 183	org/eclipse/mylyn/wikitext/core/parser/markup/Block
    //   244: astore 10
    //   246: iload 13
    //   248: istore 11
    //   250: aload 4
    //   252: iload 11
    //   254: invokevirtual 387	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setLineCharacterOffset	(I)V
    //   257: aload 10
    //   259: ifnonnull +84 -> 343
    //   262: aload 7
    //   264: ifnull +37 -> 301
    //   267: aload 7
    //   269: invokevirtual 363	java/util/Stack:isEmpty	()Z
    //   272: ifne +29 -> 301
    //   275: aload 7
    //   277: invokevirtual 364	java/util/Stack:peek	()Ljava/lang/Object;
    //   280: checkcast 183	org/eclipse/mylyn/wikitext/core/parser/markup/Block
    //   283: astore 12
    //   285: aload 12
    //   287: aload 9
    //   289: iload 11
    //   291: invokevirtual 378	org/eclipse/mylyn/wikitext/core/parser/markup/Block:canResume	(Ljava/lang/String;I)Z
    //   294: ifeq +7 -> 301
    //   297: aload 12
    //   299: astore 10
    //   301: aload 10
    //   303: ifnonnull +40 -> 343
    //   306: aload_0
    //   307: aload 9
    //   309: iload 11
    //   311: invokevirtual 407	org/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage:startBlock	(Ljava/lang/String;I)Lorg/eclipse/mylyn/wikitext/core/parser/markup/Block;
    //   314: astore 10
    //   316: aload 10
    //   318: ifnonnull +6 -> 324
    //   321: goto +147 -> 468
    //   324: aload 10
    //   326: aload_0
    //   327: invokevirtual 384	org/eclipse/mylyn/wikitext/core/parser/markup/Block:setMarkupLanguage	(Lorg/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage;)V
    //   330: aload 10
    //   332: aload 4
    //   334: invokevirtual 382	org/eclipse/mylyn/wikitext/core/parser/markup/Block:setState	(Lorg/eclipse/mylyn/wikitext/core/parser/markup/ContentState;)V
    //   337: aload 10
    //   339: aload_1
    //   340: invokevirtual 380	org/eclipse/mylyn/wikitext/core/parser/markup/Block:setParser	(Lorg/eclipse/mylyn/wikitext/core/parser/MarkupParser;)V
    //   343: aload 10
    //   345: aload 9
    //   347: iload 11
    //   349: invokevirtual 377	org/eclipse/mylyn/wikitext/core/parser/markup/Block:processLineContent	(Ljava/lang/String;I)I
    //   352: istore 11
    //   354: aload 10
    //   356: invokevirtual 374	org/eclipse/mylyn/wikitext/core/parser/markup/Block:isClosed	()Z
    //   359: ifeq +9 -> 368
    //   362: aconst_null
    //   363: astore 10
    //   365: goto +36 -> 401
    //   368: aload 10
    //   370: invokevirtual 373	org/eclipse/mylyn/wikitext/core/parser/markup/Block:beginNesting	()Z
    //   373: ifeq +28 -> 401
    //   376: aload 7
    //   378: ifnonnull +12 -> 390
    //   381: new 179	java/util/Stack
    //   384: dup
    //   385: invokespecial 362	java/util/Stack:<init>	()V
    //   388: astore 7
    //   390: aload 7
    //   392: aload 10
    //   394: invokevirtual 366	java/util/Stack:push	(Ljava/lang/Object;)Ljava/lang/Object;
    //   397: pop
    //   398: aconst_null
    //   399: astore 10
    //   401: iload 11
    //   403: aload 9
    //   405: invokevirtual 356	java/lang/String:length	()I
    //   408: if_icmpge +60 -> 468
    //   411: iload 11
    //   413: iflt +55 -> 468
    //   416: aload 10
    //   418: ifnull -291 -> 127
    //   421: new 172	java/lang/IllegalStateException
    //   424: dup
    //   425: ldc 1
    //   427: iconst_3
    //   428: anewarray 174	java/lang/Object
    //   431: dup
    //   432: iconst_0
    //   433: aload 5
    //   435: invokevirtual 420	org/eclipse/mylyn/wikitext/core/util/LocationTrackingReader:getLineNumber	()I
    //   438: invokestatic 353	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   441: aastore
    //   442: dup
    //   443: iconst_1
    //   444: iload 11
    //   446: invokestatic 353	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   449: aastore
    //   450: dup
    //   451: iconst_2
    //   452: aload 10
    //   454: invokevirtual 355	java/lang/Object:getClass	()Ljava/lang/Class;
    //   457: invokevirtual 350	java/lang/Class:getName	()Ljava/lang/String;
    //   460: aastore
    //   461: invokestatic 360	java/lang/String:format	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   464: invokespecial 351	java/lang/IllegalStateException:<init>	(Ljava/lang/String;)V
    //   467: athrow
    //   468: aload 8
    //   470: ifnull +38 -> 508
    //   473: aload 8
    //   475: invokevirtual 363	java/util/Stack:isEmpty	()Z
    //   478: ifne +30 -> 508
    //   481: aload 8
    //   483: invokevirtual 365	java/util/Stack:pop	()Ljava/lang/Object;
    //   486: checkcast 188	org/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage$LineState
    //   489: astore 12
    //   491: aload 12
    //   493: getfield 346	org/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage$LineState:line	Ljava/lang/String;
    //   496: astore 9
    //   498: aload 12
    //   500: getfield 345	org/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage$LineState:lineOffset	I
    //   503: istore 11
    //   505: goto +13 -> 518
    //   508: iconst_0
    //   509: istore 11
    //   511: aload 5
    //   513: invokevirtual 423	org/eclipse/mylyn/wikitext/core/util/LocationTrackingReader:readLine	()Ljava/lang/String;
    //   516: astore 9
    //   518: aload 9
    //   520: ifnonnull -438 -> 82
    //   523: aload 4
    //   525: aload 5
    //   527: invokevirtual 420	org/eclipse/mylyn/wikitext/core/util/LocationTrackingReader:getLineNumber	()I
    //   530: iconst_1
    //   531: iadd
    //   532: invokevirtual 389	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setLineNumber	(I)V
    //   535: aload 4
    //   537: aload 5
    //   539: invokevirtual 421	org/eclipse/mylyn/wikitext/core/util/LocationTrackingReader:getLineOffset	()I
    //   542: invokevirtual 390	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setLineOffset	(I)V
    //   545: aload 4
    //   547: iconst_0
    //   548: invokevirtual 387	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setLineCharacterOffset	(I)V
    //   551: aload 4
    //   553: iconst_0
    //   554: invokevirtual 388	org/eclipse/mylyn/wikitext/core/parser/markup/ContentState:setLineLength	(I)V
    //   557: goto +15 -> 572
    //   560: astore 11
    //   562: new 172	java/lang/IllegalStateException
    //   565: dup
    //   566: aload 11
    //   568: invokespecial 352	java/lang/IllegalStateException:<init>	(Ljava/lang/Throwable;)V
    //   571: athrow
    //   572: aload 10
    //   574: ifnull +17 -> 591
    //   577: aload 10
    //   579: invokevirtual 374	org/eclipse/mylyn/wikitext/core/parser/markup/Block:isClosed	()Z
    //   582: ifne +9 -> 591
    //   585: aload 10
    //   587: iconst_1
    //   588: invokevirtual 375	org/eclipse/mylyn/wikitext/core/parser/markup/Block:setClosed	(Z)V
    //   591: aload 7
    //   593: ifnull +41 -> 634
    //   596: goto +27 -> 623
    //   599: aload 7
    //   601: invokevirtual 365	java/util/Stack:pop	()Ljava/lang/Object;
    //   604: checkcast 183	org/eclipse/mylyn/wikitext/core/parser/markup/Block
    //   607: astore 11
    //   609: aload 11
    //   611: invokevirtual 374	org/eclipse/mylyn/wikitext/core/parser/markup/Block:isClosed	()Z
    //   614: ifne +9 -> 623
    //   617: aload 11
    //   619: iconst_1
    //   620: invokevirtual 375	org/eclipse/mylyn/wikitext/core/parser/markup/Block:setClosed	(Z)V
    //   623: aload 7
    //   625: invokevirtual 363	java/util/Stack:isEmpty	()Z
    //   628: ifeq -29 -> 599
    //   631: aconst_null
    //   632: astore 7
    //   634: iload_3
    //   635: ifeq +22 -> 657
    //   638: aload 6
    //   640: invokevirtual 368	org/eclipse/mylyn/wikitext/core/parser/D
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-2017. Infinite Loop Ltd