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

(DocumentBuilder.SpanType type, Attributes attributes)
  {
    String elementName = (String)spanTypeToElementName.get(type);
    if (elementName == null) {
      throw new IllegalStateException(type.name());
    }
    writer.writeStartElement(htmlNsUri, elementName);
    if ((type == DocumentBuilder.SpanType.LINK) && ((attributes instanceof LinkAttributes)))
    {
      String href = ((LinkAttributes)attributes).getHref();
      emitAnchorHref(href);
      applyLinkAttributes(attributes, href);
    }
    else
    {
      applyAttributes(attributes);
    }
  }
  
  public void endBlock()
  {
    writer.writeEndElement();
  }
  
  public void endHeading()
  {
    writer.writeEndElement();
  }
  
  public void endSpan()
  {
    writer.writeEndElement();
  }
  
  public void image(Attributes attributes, String url)
  {
    writer.writeEmptyElement(htmlNsUri, "img");
    applyImageAttributes(attributes);
    url = prependImageUrl(url);
    writer.writeAttribute("src", makeUrlAbsolute(url));
  }
  
  private void applyListAttributes(Attributes attributes)
  {
    applyAttributes(attributes);
    if ((attributes instanceof ListAttributes))
    {
      ListAttributes listAttributes = (ListAttributes)attributes;
      if (listAttributes.getStart() != null) {
        writer.writeAttribute("start", listAttributes.getStart());
      }
    }
  }
  
  private void applyQuoteAttributes(Attributes attributes)
  {
    applyAttributes(attributes);
    if ((attributes instanceof QuoteAttributes))
    {
      QuoteAttributes quoteAttributes = (QuoteAttributes)attributes;
      if (quoteAttributes.getCitation() != null) {
        writer.writeAttribute("cite", quoteAttributes.getCitation());
      }
    }
  }
  
  private void applyTableAttributes(Attributes attributes)
  {
    applyAttributes(attributes);
    if (attributes.getTitle() != null) {
      writer.writeAttribute("title", attributes.getTitle());
    }
    if ((attributes instanceof TableAttributes))
    {
      TableAttributes tableAttributes = (TableAttributes)attributes;
      if (tableAttributes.getBgcolor() != null) {
        writer.writeAttribute("bgcolor", tableAttributes.getBgcolor());
      }
      if (tableAttributes.getBorder() != null) {
        writer.writeAttribute("border", tableAttributes.getBorder());
      }
      if (tableAttributes.getCellpadding() != null) {
        writer.writeAttribute("cellpadding", tableAttributes.getCellpadding());
      }
      if (tableAttributes.getCellspacing() != null) {
        writer.writeAttribute("cellspacing", tableAttributes.getCellspacing());
      }
      if (tableAttributes.getFrame() != null) {
        writer.writeAttribute("frame", tableAttributes.getFrame());
      }
      if (tableAttributes.getRules() != null) {
        writer.writeAttribute("rules", tableAttributes.getRules());
      }
      if (tableAttributes.getSummary() != null) {
        writer.writeAttribute("summary", tableAttributes.getSummary());
      }
      if (tableAttributes.getWidth() != null) {
        writer.writeAttribute("width", tableAttributes.getWidth());
      }
    }
  }
  
  private void applyTableRowAttributes(Attributes attributes)
  {
    applyAttributes(attributes);
    if (attributes.getTitle() != null) {
      writer.writeAttribute("title", attributes.getTitle());
    }
    if ((attributes instanceof TableRowAttributes))
    {
      TableRowAttributes tableRowAttributes = (TableRowAttributes)attributes;
      if (tableRowAttributes.getBgcolor() != null) {
        writer.writeAttribute("bgcolor", tableRowAttributes.getBgcolor());
      }
      if (tableRowAttributes.getAlign() != null) {
        writer.writeAttribute("align", tableRowAttributes.getAlign());
      }
      if (tableRowAttributes.getValign() != null) {
        writer.writeAttribute("valign", tableRowAttributes.getValign());
      }
    }
  }
  
  private void applyCellAttributes(Attributes attributes)
  {
    applyAttributes(attributes);
    if (attributes.getTitle() != null) {
      writer.writeAttribute("title", attributes.getTitle());
    }
    if ((attributes instanceof TableCellAttributes))
    {
      TableCellAttributes tableCellAttributes = (TableCellAttributes)attributes;
      if (tableCellAttributes.getBgcolor() != null) {
        writer.writeAttribute("bgcolor", tableCellAttributes.getBgcolor());
      }
      if (tableCellAttributes.getAlign() != null) {
        writer.writeAttribute("align", tableCellAttributes.getAlign());
      }
      if (tableCellAttributes.getValign() != null) {
        writer.writeAttribute("valign", tableCellAttributes.getValign());
      }
      if (tableCellAttributes.getRowspan() != null) {
        writer.writeAttribute("rowspan", tableCellAttributes.getRowspan());
      }
      if (tableCellAttributes.getColspan() != null) {
        writer.writeAttribute("colspan", tableCellAttributes.getColspan());
      }
    }
  }
  
  private void applyImageAttributes(Attributes attributes)
  {
    int border = 0;
    ImageAttributes.Align align = null;
    if ((attributes instanceof ImageAttributes))
    {
      ImageAttributes imageAttributes = (ImageAttributes)attributes;
      border = imageAttributes.getBorder();
      align = imageAttributes.getAlign();
    }
    if (xhtmlStrict)
    {
      String borderStyle = String.format("border-width: %spx;", new Object[] { Integer.valueOf(border) });
      String alignStyle = null;
      if (align != null) {
        switch (align)
        {
        case Absbottom: 
        case Absmiddle: 
        case Top: 
          alignStyle = "text-align: " + align.name().toLowerCase() + ";";
          break;
        case Baseline: 
        case Center: 
        case Middle: 
        case Right: 
          alignStyle = "vertical-align: " + align.name().toLowerCase() + ";";
          break;
        case Bottom: 
          alignStyle = "vertical-align: text-top;";
          break;
        case Left: 
          alignStyle = "vertical-align: middle;";
          break;
        case Texttop: 
          alignStyle = "vertical-align: bottom;";
        }
      }
      String additionalStyles = borderStyle;
      if (alignStyle != null) {
        additionalStyles = additionalStyles + alignStyle;
      }
      if ((attributes.getCssStyle() == null) || (attributes.getCssStyle().length() == 0)) {
        attributes.setCssStyle(additionalStyles);
      } else {
        attributes.setCssStyle(additionalStyles + attributes.getCssStyle());
      }
    }
    applyAttributes(attributes);
    boolean haveAlt = false;
    if ((attributes instanceof ImageAttributes))
    {
      ImageAttributes imageAttributes = (ImageAttributes)attributes;
      if (imageAttributes.getHeight() != -1)
      {
        String val = Integer.toString(imageAttributes.getHeight());
        if (imageAttributes.isHeightPercentage()) {
          val = val + "%";
        }
        writer.writeAttribute("height", val);
      }
      if (imageAttributes.getWidth() != -1)
      {
        String val = Integer.toString(imageAttributes.getWidth());
        if (imageAttributes.isWidthPercentage()) {
          val = val + "%";
        }
        writer.writeAttribute("width", val);
      }
      if ((!xhtmlStrict) && (align != null)) {
        writer.writeAttribute("align", align.name().toLowerCase());
      }
      if (imageAttributes.getAlt() != null)
      {
        haveAlt = true;
        writer.writeAttribute("alt", imageAttributes.getAlt());
      }
    }
    if (attributes.getTitle() != null)
    {
      writer.writeAttribute("title", attributes.getTitle());
      if (!haveAlt)
      {
        haveAlt = true;
        writer.writeAttribute("alt", attributes.getTitle());
      }
    }
    if (xhtmlStrict)
    {
      if (!haveAlt) {
        writer.writeAttribute("alt", "");
      }
    }
    else {
      writer.writeAttribute("border", Integer.toString(border));
    }
  }
  
  private void applyLinkAttributes(Attributes attributes, String href)
  {
    applyAttributes(attributes);
    boolean hasTarget = false;
    String rel = linkRel;
    if ((attributes instanceof LinkAttributes))
    {
      LinkAttributes linkAttributes = (LinkAttributes)attributes;
      if (linkAttributes.getTarget() != null)
      {
        hasTarget = true;
        writer.writeAttribute("target", linkAttributes.getTarget());
      }
      if (linkAttributes.getRel() != null) {
        rel = linkAttributes.getRel() + ' ' + rel;
      }
    }
    if ((attributes.getTitle() != null) && (attributes.getTitle().length() > 0)) {
      writer.writeAttribute("title", attributes.getTitle());
    }
    if ((!hasTarget) && (defaultAbsoluteLinkTarget != null) && (href != null) && 
      (isExternalLink(href))) {
      writer.writeAttribute("target", defaultAbsoluteLinkTarget);
    }
    if (rel != null) {
      writer.writeAttribute("rel", rel);
    }
  }
  
  private void applyAttributes(Attributes attributes)
  {
    if (attributes.getId() != null) {
      writer.writeAttribute("id", attributes.getId());
    }
    if (attributes.getCssClass() != null) {
      writer.writeAttribute("class", attributes.getCssClass());
    }
    if (attributes.getCssStyle() != null) {
      writer.writeAttribute("style", attributes.getCssStyle());
    }
    if (attributes.getLanguage() != null) {
      writer.writeAttribute("lang", attributes.getLanguage());
    }
  }
  
  public void imageLink(Attributes linkAttributes, Attributes imageAttributes, String href, String imageUrl)
  {
    writer.writeStartElement(htmlNsUri, "a");
    emitAnchorHref(href);
    applyLinkAttributes(linkAttributes, href);
    writer.writeEmptyElement(htmlNsUri, "img");
    applyImageAttributes(imageAttributes);
    imageUrl = prependImageUrl(imageUrl);
    writer.writeAttribute("src", makeUrlAbsolute(imageUrl));
    writer.writeEndElement();
  }
  
  protected void emitAnchorHref(String href)
  {
    writer.writeAttribute("href", makeUrlAbsolute(href));
  }
  
  private String prependImageUrl(String imageUrl)
  {
    if ((prependImagePrefix == null) || (prependImagePrefix.length() == 0)) {
      return imageUrl;
    }
    if ((ABSOLUTE_URL_PATTERN.matcher(imageUrl).matches()) || (imageUrl.contains("../"))) {
      return imageUrl;
    }
    String url = prependImagePrefix;
    if (!prependImagePrefix.endsWith("/")) {
      url = url + '/';
    }
    url = url + imageUrl;
    return url;
  }
  
  public void lineBreak()
  {
    writer.writeEmptyElement(htmlNsUri, "br");
  }
  
  public void charactersUnescaped(String literal)
  {
    writer.writeLiteral(literal);
  }
  
  private static final class ElementInfo
  {
    final String name;
    final String cssClass;
    final String cssStyles;
    
    public ElementInfo(String name, String cssClass, String cssStyles)
    {
      this.name = name;
      this.cssClass = cssClass;
      this.cssStyles = ((cssStyles != null) && (!cssStyles.endsWith(";")) ? cssStyles + ';' : cssStyles);
    }
    
    public ElementInfo(String name)
    {
      this(name, null, null);
    }
  }
  
  public static class Stylesheet
  {
    private final String url;
    private final File file;
    private final Reader reader;
    private final Map<String, String> attributes = new HashMap();
    
    public Stylesheet(File file)
    {
      if (file == null) {
        throw new IllegalArgumentException();
      }
      this.file = file;
      url = null;
      reader = null;
    }
    
    public Stylesheet(String url)
    {
      if ((url == null) || (url.length() == 0)) {
        throw new IllegalArgumentException();
      }
      this.url = url;
      file = null;
      reader = null;
    }
    
    public Stylesheet(Reader reader)
    {
      if (reader == null) {
        throw new IllegalArgumentException();
      }
      this.reader = reader;
      file = null;
      url = null;
    }
    
    public Map<String, String> getAttributes()
    {
      return attributes;
    }
    
    public File getFile()
    {
      return file;
    }
    
    public String getUrl()
    {
      return url;
    }
    
    public Reader getReader()
    {
      return reader;
    }
  }
  
  private String readFully(File inputFile)
    throws IOException
  {
    int length = (int)inputFile.length();
    if (length <= 0) {
      length = 2048;
    }
    return readFully(getReader(inputFile), length);
  }
  
  /* Error */
  private String readFully(Reader input, int bufferSize)
    throws IOException
  {
    // Byte code:
    //   0: new 925	java/lang/StringBuilder
    //   3: dup
    //   4: iload_2
    //   5: invokespecial 1354	java/lang/StringBuilder:<init>	(I)V
    //   8: astore_3
    //   9: new 913	java/io/BufferedReader
    //   12: dup
    //   13: aload_1
    //   14: invokespecial 1332	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
    //   17: astore 4
    //   19: goto +11 -> 30
    //   22: aload_3
    //   23: iload 5
    //   25: i2c
    //   26: invokevirtual 1357	java/lang/StringBuilder:append	(C)Ljava/lang/StringBuilder;
    //   29: pop
    //   30: aload 4
    //   32: invokevirtual 1338	java/io/Reader:read	()I
    //   35: dup
    //   36: istore 5
    //   38: iconst_m1
    //   39: if_icmpne -17 -> 22
    //   42: goto +12 -> 54
    //   45: astore 6
    //   47: aload_1
    //   48: invokevirtual 1339	java/io/Reader:close	()V
    //   51: aload 6
    //   53: athrow
    //   54: aload_1
    //   55: invokevirtual 1339	java/io/Reader:close	()V
    //   58: aload_3
    //   59: invokevirtual 1355	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   62: areturn
    // Line number table:
    //   Java source line #1287	-> byte code offset #0
    //   Java source line #1289	-> byte code offset #9
    //   Java source line #1291	-> byte code offset #19
    //   Java source line #1292	-> byte code offset #22
    //   Java source line #1291	-> byte code offset #30
    //   Java source line #1294	-> byte code offset #45
    //   Java source line #1295	-> byte code offset #47
    //   Java source line #1296	-> byte code offset #51
    //   Java source line #1295	-> byte code offset #54
    //   Java source line #1297	-> byte code offset #58
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	63	0	this	HtmlDocumentBuilder
    //   0	63	1	input	Reader
    //   0	63	2	bufferSize	int
    //   8	51	3	buf	StringBuilder
    //   17	14	4	reader	Reader
    //   22	2	5	c	int
    //   36	3	5	c	int
    //   45	7	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   9	45	45	finally
  }
  
  protected Reader getReader(File inputFile)
    throws FileNotFoundException
  {
    return new FileReader(inputFile);
  }
  
  public void setPrependImagePrefix(String prependImagePrefix)
  {
    this.prependImagePrefix = prependImagePrefix;
  }
  
  public String getPrependImagePrefix()
  {
    return prependImagePrefix;
  }
  
  public boolean isFilterEntityReferences()
  {
    return filterEntityReferences;
  }
  
  public void setFilterEntityReferences(boolean filterEntityReferences)
  {
    this.filterEntityReferences = filterEntityReferences;
  }
}

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

abstract interface DocBookDocumentBuilder$ContentEmitter
{
  public abstract void emit();
}

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

import java.io.IOException;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.BlockType;

public class AbstractMarkupDocumentBuilder$ImplicitParagraphBlock
  extends AbstractMarkupDocumentBuilder.Block
{
  private boolean hasContent = false;
  
  public AbstractMarkupDocumentBuilder$ImplicitParagraphBlock(AbstractMarkupDocumentBuilder paramAbstractMarkupDocumentBuilder)
  {
    super(paramAbstractMarkupDocumentBuilder, DocumentBuilder.BlockType.PARAGRAPH);
  }
  
  public void write(int c)
    throws IOException
  {
    hasContent = true;
    this$0.emitContent(this$0.normalizeWhitespace(c));
  }
  
  public void write(String s)
    throws IOException
  {
    hasContent = true;
    this$0.emitContent(this$0.normalizeWhitespace(s));
  }
  
  public void close()
    throws IOException
  {
    if (hasContent) {
      this$0.emitContent("\n\n");
    }
    super.close();
  }
}

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

class XslfoDocumentBuilder$ElementInfo
{
  int size = 1;
}

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

import java.io.IOException;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.BlockType;

public class AbstractMarkupDocumentBuilder$SuffixBlock
  extends AbstractMarkupDocumentBuilder.Block
{
  private final String suffix;
  
  public AbstractMarkupDocumentBuilder$SuffixBlock(AbstractMarkupDocumentBuilder paramAbstractMarkupDocumentBuilder, DocumentBuilder.BlockType blockType, String suffix)
  {
    super(paramAbstractMarkupDocumentBuilder, blockType);
    this.suffix = suffix;
  }
  
  public void close()
    throws IOException
  {
    this$0.emitContent(suffix);
    super.close();
  }
}

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

import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Stack;
import org.eclipse.mylyn.internal.wikitext.core.parser.builder.DitaTopicDocumentBuilder;
import org.eclipse.mylyn.wikitext.core.parser.Attributes;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.BlockType;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.SpanType;
import org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem;
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 DitaBookMapDocumentBuilder
  extends AbstractXmlDocumentBuilder
  implements Closeable
{
  private String bookTitle;
  private String doctype = "<!DOCTYPE bookmap PUBLIC \"-//OASIS//DTD DITA 1.1 BookMap//EN\"  \"http://docs.oasis-open.org/dita/v1.1/OS/dtd/bookmap.dtd\">";
  private String topicDoctype;
  private String topicFilenameSuffix = ".dita";
  private String topicFolder;
  private File targetFile;
  private DitaTopicDocumentBuilder currentTopic;
  private String latestHeadingId;
  private File currentTopicFile;
  private final Stack<Integer> headingLevels = new Stack();
  private boolean mapEntryOpen;
  private String titleText;
  private Writer currentTopicOut;
  private OutlineItem outline;
  private int topicBreakLevel = 1;
  private boolean formattingDependencies = true;
  
  public DitaBookMapDocumentBuilder(Writer out)
  {
    super(out);
  }
  
  public DitaBookMapDocumentBuilder(XmlStreamWriter writer)
  {
    super(writer);
  }
  
  protected XmlStreamWriter createXmlStreamWriter(Writer out)
  {
    XmlStreamWriter writer = super.createXmlStreamWriter(out);
    return new FormattingXMLStreamWriter(writer);
  }
  
  public String getBookTitle()
  {
    return bookTitle;
  }
  
  public void setBookTitle(String bookTitle)
  {
    this.bookTitle = bookTitle;
  }
  
  public String getTopicDoctype()
  {
    return topicDoctype;
  }
  
  public void setTopicDoctype(String topicDoctype)
  {
    this.topicDoctype = topicDoctype;
  }
  
  public String getDoctype()
  {
    return doctype;
  }
  
  public void setDoctype(String doctype)
  {
    this.doctype = doctype;
  }
  
  public String getTopicFilenameSuffix()
  {
    return topicFilenameSuffix;
  }
  
  public void setTopicFilenameSuffix(String topicFilenameSuffix)
  {
    this.topicFilenameSuffix = topicFilenameSuffix;
  }
  
  public String getTopicFolder()
  {
    return topicFolder;
  }
  
  public void setTopicFolder(String topicFolder)
  {
    this.topicFolder = topicFolder;
  }
  
  public File getTargetFile()
  {
    return targetFile;
  }
  
  public void setTargetFile(File targetFile)
  {
    this.targetFile = targetFile;
  }
  
  private DitaTopicDocumentBuilder getCurrentTopic()
  {
    if (currentTopic == null)
    {
      try
      {
        currentTopicFile = computeFile(latestHeadingId);
        currentTopicOut = new OutputStreamWriter(new BufferedOutputStream(
          new FileOutputStream(currentTopicFile)), "utf-8");
      }
      catch (IOException e1)
      {
        throw new IllegalStateException(e1);
      }
      String relativeTopic = currentTopicFile.getName();
      if (topicFolder != null) {
        relativeTopic = topicFolder + '/' + relativeTopic;
      }
      writer.writeEmptyElement("chapter");
      writer.writeAttribute("href", relativeTopic);
      titleText = "";
      mapEntryOpen = true;
      
      currentTopic = new DitaTopicDocumentBuilder(new DefaultXmlStreamWriter(currentTopicOut), 
        formattingDependencies);
      if (topicDoctype != null) {
        currentTopic.setDoctype(topicDoctype);
      }
      currentTopic.setTopicBreakLevel(topicBreakLevel);
      currentTopic.setOutline(outline);
      currentTopic.setFilename(currentTopicFile.getName());
      currentTopic.beginDocument();
    }
    return currentTopic;
  }
  
  private File computeFile(String headingId)
  {
    String name = DitaTopicDocumentBuilder.computeName(headingId, topicFilenameSuffix);
    
    File folder = targetFile.getParentFile();
    if (topicFolder != null) {
      folder = new File(folder, topicFolder);
    }
    return new File(folder, name);
  }
  
  public void acronym(String text, String definition)
  {
    getCurrentTopic().acronym(text, definition);
  }
  
  public void beginBlock(DocumentBuilder.BlockType type, Attributes attributes)
  {
    getCurrentTopic().beginBlock(type, attributes);
  }
  
  public void beginHeading(int level, Attributes attributes)
  {
    headingLevels.push(Integer.valueOf(level));
    if (level <= topicBreakLevel)
    {
      closeCurrentTopic();
      latestHeadingId = attributes.getId();
    }
    getCurrentTopic().beginHeading(level, attributes);
  }
  
  public void beginSpan(DocumentBuilder.SpanType type, Attributes attributes)
  {
    getCurrentTopic().beginSpan(type, attributes);
  }
  
  public void characters(String text)
  {
    if (mapEntryOpen) {
      titleText += text;
    }
    getCurrentTopic().characters(text);
  }
  
  public void charactersUnescaped(String literal)
  {
    getCurrentTopic().charactersUnescaped(literal);
  }
  
  public void endBlock()
  {
    getCurrentTopic().endBlock();
  }
  
  public void beginDocument()
  {
    writer.writeStartDocument();
    writer.writeDTD(doctype);
    
    writer.writeStartElement("bookmap");
    writer.writeStartElement("title");
    if (bookTitle != null) {
      writer.writeCharacters(bookTitle);
    }
    writer.writeEndElement();
  }
  
  public void endDocument()
  {
    closeCurrentTopic();
    
    writer.writeEndElement();
    writer.writeEndDocument();
  }
  
  private void closeCurrentTopic()
  {
    if (currentTopic != null)
    {
      currentTopic.endDocument();
      currentTopic = null;
      if (currentTopicOut != null)
      {
        try
        {
          currentTopicOut.close();
        }
        catch (IOException e)
        {
          throw new IllegalStateException(e);
        }
        currentTopicOut = null;
      }
    }
  }
  
  public void endHeading()
  {
    int level = ((Integer)headingLevels.pop()).intValue();
    if ((level <= topicBreakLevel) && 
      (mapEntryOpen))
    {
      mapEntryOpen = false;
      writer.writeAttribute("navtitle", titleText);
      titleText = null;
    }
    getCurrentTopic().endHeading();
  }
  
  public void endSpan()
  {
    getCurrentTopic().endSpan();
  }
  
  public void entityReference(String entity)
  {
    getCurrentTopic().entityReference(entity);
  }
  
  public void image(Attributes attributes, String url)
  {
    getCurrentTopic().image(attributes, url);
  }
  
  public void imageLink(Attributes linkAttributes, Attributes imageAttributes, String href, String imageUrl)
  {
    getCurrentTopic().imageLink(linkAttributes, imageAttributes, href, imageUrl);
  }
  
  public void lineBreak()
  {
    getCurrentTopic().lineBreak();
  }
  
  public void link(Attributes attributes, String hrefOrHashName, String text)
  {
    getCurrentTopic().link(attributes, hrefOrHashName, text);
  }
  
  public void close()
    throws IOException
  {
    if (currentTopicOut != null)
    {
      try
      {
        currentTopicOut.close();
      }
      catch (IOException e)
      {
        throw new IllegalStateException(e);
      }
      currentTopicOut = null;
    }
  }
  
  public OutlineItem getOutline()
  {
    return outline;
  }
  
  public void setOutline(OutlineItem outline)
  {
    this.outline = outline;
  }
  
  public int getTopicBreakLevel()
  {
    return topicBreakLevel;
  }
  
  public void setTopicBreakLevel(int topicBreakLevel)
  {
    this.topicBreakLevel = topicBreakLevel;
  }
  
  public boolean isFormattingDependencies()
  {
    return formattingDependencies;
  }
  
  public void setFormattingDependencies(boolean formattingDependencies)
  {
    this.formattingDependencies = formattingDependencies;
  }
}

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

final class HtmlDocumentBuilder$ElementInfo
{
  final String name;
  final String cssClass;
  final String cssStyles;
  
  public HtmlDocumentBuilder$ElementInfo(String name, String cssClass, String cssStyles)
  {
    this.name = name;
    this.cssClass = cssClass;
    this.cssStyles = ((cssStyles != null) && (!cssStyles.endsWith(";")) ? cssStyles + ';' : cssStyles);
  }
  
  public HtmlDocumentBuilder$ElementInfo(String name)
  {
    this(name, null, null);
  }
}

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

public class XslfoDocumentBuilder$Margins
  implements Cloneable
{
  private float marginTop = 1.5F;
  private float marginBottom = 1.5F;
  private float marginLeft = 1.5F;
  private float marginRight = 1.5F;
  
  public XslfoDocumentBuilder$Margins() {}
  
  public XslfoDocumentBuilder$Margins(float top, float bottom, float left, float right)
  {
    marginTop = top;
    marginBottom = bottom;
    marginLeft = left;
    marginRight = right;
  }
  
  public void setMarginTop(float marginTop)
  {
    this.marginTop = marginTop;
  }
  
  public float getMarginTop()
  {
    return marginTop;
  }
  
  public void setMarginBottom(float marginBottom)
  {
    this.marginBottom = marginBottom;
  }
  
  public float getMarginBottom()
  {
    return marginBottom;
  }
  
  public void setMarginLeft(float marginLeft)
  {
    this.marginLeft = marginLeft;
  }
  
  public float getMarginLeft()
  {
    return marginLeft;
  }
  
  public void setMarginRight(float marginRight)
  {
    this.marginRight = marginRight;
  }
  
  public float getMarginRight()
  {
    return marginRight;
  }
}

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

abstract interface package-info {}

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

public class XslfoDocumentBuilder$Region
  implements Cloneable
{
  private float extent = 3.0F;
  private boolean precedence = false;
  private String location = null;
  private String name = null;
  
  public XslfoDocumentBuilder$Region() {}
  
  public XslfoDocumentBuilder$Region(String name, float extent, boolean precedence)
  {
    this.name = name;
    this.extent = extent;
    this.precedence = precedence;
  }
  
  public XslfoDocumentBuilder$Region(String location, String name, float extent, boolean precedence)
  {
    this.location = location;
    this.extent = extent;
    this.precedence = precedence;
    this.name = name;
  }
  
  public void setExtent(float extent)
  {
    this.extent = extent;
  }
  
  public float getExtent()
  {
    return extent;
  }
  
  public void setPrecedence(boolean precedence)
  {
    this.precedence = precedence;
  }
  
  public boolean isPrecedence()
  {
    return precedence;
  }
  
  public void setName(String name)
  {
    this.name = name;
  }
  
  public String getName()
  {
    return name;
  }
}

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

import java.util.ArrayList;
import java.util.Arrays;
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.BlockType;
import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.SpanType;
import org.eclipse.mylyn.wikitext.core.parser.Locator;

public class MultiplexingDocumentBuilder
  extends DocumentBuilder
{
  private final List<DocumentBuilder> builders = new ArrayList();
  
  public MultiplexingDocumentBuilder(DocumentBuilder... delegates)
  {
    builders.addAll(Arrays.asList(delegates));
  }
  
  public void addDocumentBuilder(DocumentBuilder delegate)
  {
    builders.add(delegate);
  }
  
  public void acronym(String text, String definition)
  {
    for (DocumentBuilder builder : builders) {
      builder.acronym(text, definition);
    }
  }
  
  public void beginBlock(DocumentBuilder.BlockType type, Attributes attributes)
  {
    for (DocumentBuilder builder : builders) {
      builder.beginBlock(type, attributes);
    }
  }
  
  public void beginDocument()
  {
    for (DocumentBuilder builder : builders) {
      builder.beginDocument();
    }
  }
  
  public void beginHeading(int level, Attributes attributes)
  {
    for (DocumentBuilder builder : builders) {
      builder.beginHeading(level, attributes);
    }
  }
  
  public void beginSpan(DocumentBuilder.SpanType type, Attributes attributes)
  {
    for (DocumentBuilder builder : builders) {
      builder.beginSpan(type, attributes);
    }
  }
  
  public void characters(String text)
  {
    for (DocumentBuilder builder : builders) {
      builder.characters(text);
    }
  }
  
  public void charactersUnescaped(String literal)
  {
    for (DocumentBuilder builder : builders) {
      builder.charactersUnescaped(literal);
    }
  }
  
  public void endBlock()
  {
    for (DocumentBuilder builder : builders) {
      builder.endBlock();
    }
  }
  
  public void endDocument()
  {
    for (DocumentBuilder builder : builders) {
      builder.endDocument();
    }
  }
  
  public void endHeading()
  {
    for (DocumentBuilder builder : builders) {
      builder.endHeading();
    }
  }
  
  public void endSpan()
  {
    for (DocumentBuilder builder : builders) {
      builder.endSpan();
    }
  }
  
  public void entityReference(String entity)
  {
    for (DocumentBuilder builder : builders) {
      builder.entityReference(entity);
    }
  }
  
  public void image(Attributes attributes, String url)
  {
    for (DocumentBuilder builder : builders) {
      builder.image(attributes, url);
    }
  }
  
  public void imageLink(Attributes linkAttributes, Attributes imageAttributes, String href, String imageUrl)
  {
    for (DocumentBuilder builder : builders) {
      builder.imageLink(linkAttributes, imageAttributes, href, imageUrl);
    }
  }
  
  public void lineBreak()
  {
    for (DocumentBuilder builder : builders) {
      builder.lineBreak();
    }
  }
  
  public void link(Attributes attributes, String hrefOrHashName, String text)
  {
    for (DocumentBuilder builder : builders) {
      builder.link(attributes, hrefOrHashName, text);
    }
  }
  
  public void setLocator(Locator locator)
  {
    super.setLocator(locator);
    for (DocumentBuilder builder : builders) {
      builder.setLocator(locator);
    }
  }
}

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

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

class XslfoDocumentBuilder$SpanInfo
  extends XslfoDocumentBuilder.ElementInfo
{
  final DocumentBuilder.SpanType type;
  
  public XslfoDocumentBuilder$SpanInfo(DocumentBuilder.SpanType type)
  {
    super(null);
    this.type = type;
  }
}

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

public class XslfoDocumentBuilder$Configuration
  implements Cloneable
{
  private float[] fontSizes = { 12.0F, 18.0F, 15.0F, 13.2F, 12.0F, 10.4F, 8.0F };
  private final float[] fontSizeMultipliers = { 1.0F, 1.5F, 1.25F, 1.1F, 1.0F, 0.83F, 0.67F };
  private boolean pageBreakOnHeading1 = true;
  private boolean showExternalLinks = true;
  private boolean underlineLinks = false;
  private boolean panelText = true;
  private String title;
  private String subTitle;
  private String version;
  private String date;
  private String author;
  private String copyright;
  private boolean pageNumbering = true;
  private float pageMargin = 1.5F;
  private float pageHeight = 29.7F;
  private float pageWidth = 21.0F;
  private XslfoDocumentBuilder.Margins pageMargins = null;
  private XslfoDocumentBuilder.Margins bodyMargins = null;
  private XslfoDocumentBuilder.Region bodyBeforeRegion = null;
  private XslfoDocumentBuilder.Region bodyAfterRegion = null;
  private XslfoDocumentBuilder.Region bodyStartRegion = null;
  private XslfoDocumentBuilder.Region bodyEndRegion = null;
  private float referenceOrientation = 90.0F;
  
  public XslfoDocumentBuilder$Configuration()
  {
    setFontSize(10.0F);
  }
  
  public Configuration clone()
  {
    try
    {
      return (Configuration)super.clone();
    }
    catch (CloneNotSupportedException e)
    {
      throw new IllegalStateException(e);
    }
  }
  
  public void setFontSize(float fontSize)
  {
    fontSizes = new float[fontSizeMultipliers.length];
    for (int x = 0; x < fontSizeMultipliers.length; x++) {
      fontSizes[x] = (fontSizeMultipliers[x] * fontSize);
    }
  }
  
  public float getFontSize()
  {
    return fontSizes[0];
  }
  
  public void setFontSizeMultipliers(float[] fontSizeMultipliers)
  {
    if (fontSizeMultipliers.length != 7) {
      throw new IllegalArgumentException();
    }
    for (int x = 0; x < fontSizeMultipliers.length; x++) {
      if (fontSizeMultipliers[x] < 0.2D) {
        throw new IllegalArgumentException();
      }
    }
    System.arraycopy(fontSizeMultipliers, 0, this.fontSizeMultipliers, 0, 7);
  }
  
  public float[] getFontSizeMultipliers()
  {
    float[] values = new float[7];
    System.arraycopy(fontSizeMultipliers, 0, values, 0, 7);
    return values;
  }
  
  public boolean isShowExternalLinks()
  {
    return showExternalLinks;
  }
  
  public void setShowExternalLinks(boolean showExternalLinks)
  {
    this.showExternalLinks = showExternalLinks;
  }
  
  public boolean isUnderlineLinks()
  {
    return underlineLinks;
  }
  
  public void setUnderlineLinks(boolean underlineLinks)
  {
    this.underlineLinks = underlineLinks;
  }
  
  public boolean isPageBreakOnHeading1()
  {
    return pageBreakOnHeading1;
  }
  
  public void setPageBreakOnHeading1(boolean pageBreakOnHeading1)
  {
    this.pageBreakOnHeading1 = pageBreakOnHeading1;
  }
  
  public String getTitle()
  {
    return title;
  }
  
  public void setTitle(String title)
  {
    this.title = title;
  }
  
  public String getSubTitle()
  {
    return subTitle;
  }
  
  public void setSubTitle(String subTitle)
  {
    this.subTitle = subTitle;
  }
  
  public boolean isPanelText()
  {
    return panelText;
  }
  
  public void setPanelText(boolean panelText)
  {
    this.panelText = panelText;
  }
  
  public String getVersion()
  {
    return version;
  }
  
  public void setVersion(String version)
  {
    this.version = version;
  }
  
  public String getDate()
  {
    return date;
  }
  
  public void setDate(String date)
  {
    this.date = date;
  }
  
  public String getAuthor()
  {
    return author;
  }
  
  public void setAuthor(String author)
  {
    this.author = author;
  }
  
  public String getCopyright()
  {
    return copyright;
  }
  
  public void setCopyright(String copyright)
  {
    this.copyright = copyright;
  }
  
  public boolean isPageNumbering()
  {
    return pageNumbering;
  }
  
  public void setPageNumbering(boolean pageNumbering)
  {
    this.pageNumbering = pageNumbering;
  }
  
  public float getPageMargin()
  {
    return pageMargin;
  }
  
  public void setPageMargin(float pageMargin)
  {
    this.pageMargin = pageMargin;
  }
  
  public float getPageHeight()
  {
    return pageHeight;
  }
  
  public void setPageHeight(float pageHeight)
  {
    this.pageHeight = pageHeight;
  }
  
  public float getPageWidth()
  {
    return pageWidth;
  }
  
  public void setPageWidth(float pageWidth)
  {
    this.pageWidth = pageWidth;
  }
  
  public void setReferenceOrientation(float referenceOrientation)
  {
    this.referenceOrientation = referenceOrientation;
  }
  
  public float getReferenceOrientation()
  {
    return referenceOrientation;
  }
  
  public XslfoDocumentBuilder.Margins getPageMargins()
  {
    return pageMargins;
  }
  
  public XslfoDocumentBuilder.Margins getBodyMargins()
  {
    return bodyMargins;
  }
  
  public void setPageMargins(XslfoDocumentBuilder.Margins pageMargins)
  {
    this.pageMargins = pageMargins;
  }
  
  public void setBodyMargins(XslfoDocumentBuilder.Margins bodyMargins)
  {
    this.bodyMargins = bodyMargins;
  }
  
  public void setBodyBeforeRegion(XslfoDocumentBuilder.Region region)
  {
    region.setName("before");
    bodyBeforeRegion = region;
  }
  
  public XslfoDocumentBuilder.Region getBodyBeforeRegion()
  {
    return bodyBeforeRegion;
  }
  
  public void setBodyAfterRegion(XslfoDocumentBuilder.Region region)
  {
    region.setName("after");
    bodyAfterRegion = region;
  }
  
  public XslfoDocumentBuilder.Region getBodyAfterRegion()
  {
    return bodyAfterRegion;
  }
  
  public void setBodyStartRegion(XslfoDocumentBuilder.Region region)
  {
    region.setName("start");
    bodyStartRegion = region;
  }
  
  public XslfoDocumentBuilder.Region getBodyStartRegion()
  {
    return bodyStartRegion;
  }
  
  public void setBodyEndRegion(XslfoDocumentBuilder.Region region)
  {
    region.setName("end");
    bo
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