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

16:47:03.957 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.wikitext.core_1.6.1.v20120425-0100.jar
package org.eclipse.mylyn.wikitext.core.util;

import org.eclipse.mylyn.wikitext.core.parser.Locator;

public class LocatorImpl
  implements Locator
{
  private final int documentOffset;
  private final int lineCharacterOffset;
  private final int lineDocumentOffset;
  private final int lineLength;
  private final int lineNumber;
  private final int lineSegmentEndOffset;
  
  public LocatorImpl(Locator other)
  {
    documentOffset = other.getDocumentOffset();
    lineCharacterOffset = other.getLineCharacterOffset();
    lineDocumentOffset = other.getLineDocumentOffset();
    lineLength = other.getLineLength();
    lineNumber = other.getLineNumber();
    lineSegmentEndOffset = other.getLineSegmentEndOffset();
  }
  
  public int getDocumentOffset()
  {
    return documentOffset;
  }
  
  public int getLineCharacterOffset()
  {
    return lineCharacterOffset;
  }
  
  public int getLineDocumentOffset()
  {
    return lineDocumentOffset;
  }
  
  public int getLineLength()
  {
    return lineLength;
  }
  
  public int getLineNumber()
  {
    return lineNumber;
  }
  
  public int getLineSegmentEndOffset()
  {
    return lineSegmentEndOffset;
  }
}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Constructor;
import java.net.URL;
import java.text.MessageFormat;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;

public class ServiceLocator
{
  private static final String UTF_8 = "utf-8";
  protected final ClassLoader classLoader;
  private static Class<? extends ServiceLocator> implementationClass;
  private static Pattern CLASS_NAME_PATTERN = Pattern.compile("\\s*([^\\s#]+)?#?.*");
  
  protected ServiceLocator(ClassLoader classLoader)
  {
    this.classLoader = classLoader;
  }
  
  public static ServiceLocator getInstance(ClassLoader classLoader)
  {
    if (implementationClass != null) {
      try
      {
        return (ServiceLocator)implementationClass.getConstructor(new Class[] { ClassLoader.class }).newInstance(new Object[] { classLoader });
      }
      catch (Exception e)
      {
        throw new IllegalStateException(e);
      }
    }
    return new ServiceLocator(classLoader);
  }
  
  public static ServiceLocator getInstance()
  {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    if (loader == null) {
      ServiceLocator.class.getClassLoader();
    }
    return getInstance(loader);
  }
  
  public MarkupLanguage getMarkupLanguage(final String languageName)
    throws IllegalArgumentException
  {
    if (languageName == null) {
      throw new IllegalArgumentException();
    }
    Pattern classNamePattern = Pattern.compile("\\s*([^\\s#]+)?#?.*");
    
    final Set<String> names = new TreeSet();
    
    final MarkupLanguage[] result = new MarkupLanguage[1];
    
    loadMarkupLanguages(new MarkupLanguageVisitor()
    {
      public boolean accept(MarkupLanguage language)
      {
        if (languageName.equals(language.getName()))
        {
          result[0] = language;
          return false;
        }
        names.add(language.getName());
        return true;
      }
    });
    if (result[0] != null) {
      return result[0];
    }
    Matcher matcher = classNamePattern.matcher(languageName);
    MarkupLanguage instance;
    if (matcher.matches())
    {
      String className = matcher.group(1);
      if (className != null) {
        try
        {
          Class<?> clazz = Class.forName(className, true, classLoader);
          if (MarkupLanguage.class.isAssignableFrom(clazz)) {
            return (MarkupLanguage)clazz.newInstance();
          }
        }
        catch (Exception localException) {}
      }
    }
    StringBuilder buf = new StringBuilder();
    for (String name : names)
    {
      if (buf.length() != 0) {
        buf.append(", ");
      }
      buf.append('\'');
      buf.append(name);
      buf.append('\'');
    }
    throw new IllegalArgumentException(MessageFormat.format(Messages.getString("ServiceLocator.4"), new Object[] {
      languageName, 
      Messages.getString("ServiceLocator.6") + buf }));
  }
  
  public Set<MarkupLanguage> getAllMarkupLanguages()
  {
    final Set<MarkupLanguage> markupLanguages = new HashSet();
    loadMarkupLanguages(new MarkupLanguageVisitor()
    {
      public boolean accept(MarkupLanguage language)
      {
        markupLanguages.add(language);
        return true;
      }
    });
    return markupLanguages;
  }
  
  public static void setImplementation(Class<? extends ServiceLocator> implementationClass)
  {
    implementationClass = implementationClass;
  }
  
  private void loadMarkupLanguages(MarkupLanguageVisitor visitor)
  {
    try
    {
      String servicesFilename = "META-INF/services/" + MarkupLanguage.class.getName();
      Enumeration<URL> resources = classLoader.getResources(servicesFilename);
      while (resources.hasMoreElements())
      {
        URL url = (URL)resources.nextElement();
        try
        {
          BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), "utf-8"));
          try
          {
            String line;
            while ((line = reader.readLine()) != null)
            {
              String line;
              Matcher matcher = CLASS_NAME_PATTERN.matcher(line);
              if (matcher.matches())
              {
                String className = matcher.group(1);
                if (className != null) {
                  try
                  {
                    Class<?> clazz = Class.forName(className, true, classLoader);
                    if (MarkupLanguage.class.isAssignableFrom(clazz))
                    {
                      MarkupLanguage instance = (MarkupLanguage)clazz.newInstance();
                      if (!visitor.accept(instance)) {
                        return;
                      }
                    }
                  }
                  catch (Exception e)
                  {
                    Logger.getLogger(ServiceLocator.class.getName()).log(Level.WARNING, 
                      MessageFormat.format(
                      Messages.getString("ServiceLocator.0"), new Object[] { className }), e);
                  }
                }
              }
            }
          }
          finally
          {
            reader.close();
          }
          reader.close();
        }
        catch (IOException localIOException1) {}
      }
    }
    catch (IOException e)
    {
      Logger.getLogger(ServiceLocator.class.getName()).log(Level.SEVERE, 
        Messages.getString("ServiceLocator.1"), e);
    }
  }
  
  private static abstract interface MarkupLanguageVisitor
  {
    public abstract boolean accept(MarkupLanguage paramMarkupLanguage);
  }
}

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

import java.util.Stack;

public class FormattingXMLStreamWriter
  extends XmlStreamWriter
{
  private final XmlStreamWriter delegate;
  private int indentLevel;
  private final Stack<Integer> childCounts = new Stack();
  private int childCount;
  private final Stack<String> elements = new Stack();
  private int lineOffset = 0;
  
  public FormattingXMLStreamWriter(XmlStreamWriter delegate)
  {
    this.delegate = delegate;
  }
  
  public void close()
  {
    delegate.close();
  }
  
  public void flush()
  {
    delegate.flush();
  }
  
  public String getPrefix(String uri)
  {
    return delegate.getPrefix(uri);
  }
  
  public void setDefaultNamespace(String uri)
  {
    delegate.setDefaultNamespace(uri);
  }
  
  public void setPrefix(String prefix, String uri)
  {
    delegate.setPrefix(prefix, uri);
  }
  
  public void writeAttribute(String prefix, String namespaceURI, String localName, String value)
  {
    if (value == null) {
      value = "";
    }
    delegate.writeAttribute(prefix, namespaceURI, localName, value);
  }
  
  public void writeAttribute(String namespaceURI, String localName, String value)
  {
    if (value == null) {
      value = "";
    }
    delegate.writeAttribute(namespaceURI, localName, value);
  }
  
  public void writeAttribute(String localName, String value)
  {
    if (value == null) {
      value = "";
    }
    delegate.writeAttribute(localName, value);
  }
  
  public void writeCData(String data)
  {
    delegate.writeCData(data);
  }
  
  public void writeCharacters(char[] text, int start, int len)
  {
    int lineStart = start;
    int length = 0;
    for (int x = 0; x < len; x++)
    {
      int charOffset = start + x;
      length++;
      if ((lineOffset == 0) && (text[charOffset] != '\n')) {
        maybeIndent(false, true);
      }
      lineOffset += 1;
      if (text[charOffset] == '\n')
      {
        delegate.writeCharacters(text, lineStart, length);
        length = 0;
        lineOffset = 0;
        lineStart = charOffset;
      }
    }
    if (length > 0)
    {
      delegate.writeCharacters(text, lineStart, length);
      lineOffset += length;
    }
  }
  
  public void writeCharacters(String text)
  {
    if (text == null) {
      return;
    }
    char[] chars = text.toCharArray();
    writeCharacters(chars, 0, chars.length);
  }
  
  public void writeLiteral(String literal)
  {
    delegate.writeLiteral(literal);
  }
  
  public void writeComment(String data)
  {
    if (data == null) {
      data = "";
    }
    delegate.writeComment(data);
  }
  
  public void writeDefaultNamespace(String namespaceURI)
  {
    delegate.writeDefaultNamespace(namespaceURI);
  }
  
  public void writeDTD(String dtd)
  {
    delegate.writeDTD(dtd);
  }
  
  public void writeEmptyElement(String prefix, String localName, String namespaceURI)
  {
    childCount += 1;
    maybeIndent();
    delegate.writeEmptyElement(prefix, localName, namespaceURI);
  }
  
  public void writeEmptyElement(String namespaceURI, String localName)
  {
    childCount += 1;
    maybeIndent();
    delegate.writeEmptyElement(namespaceURI, localName);
  }
  
  public void writeEmptyElement(String localName)
  {
    childCount += 1;
    maybeIndent();
    delegate.writeEmptyElement(localName);
  }
  
  public void writeEndDocument()
  {
    delegate.writeEndDocument();
  }
  
  public void writeEndElement()
  {
    indentLevel -= 1;
    maybeIndent();
    elements.pop();
    delegate.writeEndElement();
    childCount = ((Integer)childCounts.pop()).intValue();
  }
  
  public void writeEntityRef(String name)
  {
    delegate.writeEntityRef(name);
  }
  
  public void writeNamespace(String prefix, String namespaceURI)
  {
    delegate.writeNamespace(prefix, namespaceURI);
  }
  
  public void writeProcessingInstruction(String target, String data)
  {
    delegate.writeProcessingInstruction(target, data);
  }
  
  public void writeProcessingInstruction(String target)
  {
    delegate.writeProcessingInstruction(target);
  }
  
  public void writeStartDocument()
  {
    delegate.writeStartDocument();
  }
  
  public void writeStartDocument(String encoding, String version)
  {
    delegate.writeStartDocument(encoding, version);
  }
  
  public void writeStartDocument(String version)
  {
    delegate.writeStartDocument(version);
  }
  
  public void writeStartElement(String prefix, String localName, String namespaceURI)
  {
    childCount += 1;
    maybeIndent();
    elements.push(localName);
    childCounts.push(Integer.valueOf(childCount));
    childCount = 0;
    indentLevel += 1;
    delegate.writeStartElement(prefix, localName, namespaceURI);
  }
  
  public void writeStartElement(String namespaceURI, String localName)
  {
    childCount += 1;
    maybeIndent();
    elements.push(localName);
    childCounts.push(Integer.valueOf(childCount));
    childCount = 0;
    indentLevel += 1;
    delegate.writeStartElement(namespaceURI, localName);
  }
  
  public void writeStartElement(String localName)
  {
    childCount += 1;
    maybeIndent();
    elements.push(localName);
    childCounts.push(Integer.valueOf(childCount));
    childCount = 0;
    indentLevel += 1;
    delegate.writeStartElement(localName);
  }
  
  private void maybeIndent()
  {
    maybeIndent(true, false);
  }
  
  private void maybeIndent(boolean withNewline, boolean force)
  {
    if (((childCount == 0) && (!force)) || (preserveWhitespace())) {
      return;
    }
    StringBuilder buf = new StringBuilder();
    if (withNewline) {
      buf.append('\n');
    }
    for (int x = 0; x < indentLevel; x++) {
      buf.append('\t');
    }
    lineOffset = indentLevel;
    delegate.writeCharacters(buf.toString().toCharArray(), 0, buf.length());
  }
  
  private boolean preserveWhitespace()
  {
    for (int x = elements.size() - 1; x >= 0; x--) {
      if (preserveWhitespace((String)elements.get(x))) {
        return true;
      }
    }
    return false;
  }
  
  protected boolean preserveWhitespace(String elementName)
  {
    return false;
  }
}

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

abstract interface package-info {}

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

import java.util.Set;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;

class ServiceLocator$1
  implements ServiceLocator.MarkupLanguageVisitor
{
  ServiceLocator$1(ServiceLocator paramServiceLocator, String paramString, MarkupLanguage[] paramArrayOfMarkupLanguage, Set paramSet) {}
  
  public boolean accept(MarkupLanguage language)
  {
    if (val$languageName.equals(language.getName()))
    {
      val$result[0] = language;
      return false;
    }
    val$names.add(language.getName());
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.util.ServiceLocator.1
 * 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.Reader;

public class LocationTrackingReader
  extends Reader
{
  private final Reader delegate;
  private int offset = -1;
  private int lineOffset = -1;
  private int lineNumber = -1;
  private char[] buf;
  private int bufOffset = 0;
  private int bufLength = 0;
  
  public LocationTrackingReader(Reader delegate)
  {
    this(delegate, 2048);
  }
  
  public LocationTrackingReader(Reader delegate, int bufferSize)
  {
    this.delegate = delegate;
    buf = new char[bufferSize];
  }
  
  public void close()
    throws IOException
  {
    delegate.close();
  }
  
  public int read(char[] cbuf, int off, int len)
    throws IOException
  {
    if (bufLength > 0)
    {
      int length = Math.min(len, bufLength);
      System.arraycopy(buf, bufOffset, cbuf, off, length);
      bufLength -= length;
      bufOffset += length;
      if (bufLength == 0) {
        bufOffset = 0;
      }
      offset += length;
      return length;
    }
    int read = delegate.read(cbuf, off, len);
    if (read != -1) {
      offset += read;
    }
    return read;
  }
  
  public int read()
    throws IOException
  {
    if (bufLength > 0)
    {
      int c = buf[bufOffset];
      bufLength -= 1;
      bufOffset += 1;
      if (bufLength == 0) {
        bufOffset = 0;
      }
      offset += 1;
      return c;
    }
    int read = delegate.read();
    if (read != -1) {
      offset += 1;
    }
    return read;
  }
  
  public String readLine()
    throws IOException
  {
    lineOffset = (offset + 1);
    
    int lineBufOffset = bufOffset;
    int c = -1;
    for (int x = lineBufOffset;; x++)
    {
      if (x >= bufOffset + bufLength)
      {
        if ((bufOffset > 0) && (bufLength > 0))
        {
          System.arraycopy(buf, bufOffset, buf, 0, bufLength);
          x -= bufOffset;
          bufOffset = 0;
          lineBufOffset = 0;
        }
        if (bufOffset + bufLength >= buf.length)
        {
          char[] newBuf = new char[buf.length * 2];
          if (bufLength > 0) {
            System.arraycopy(buf, bufOffset, newBuf, 0, bufLength);
          }
          x -= bufOffset;
          bufOffset = 0;
          lineBufOffset = 0;
          buf = newBuf;
        }
        int emptyOffset = bufOffset + bufLength;
        int read = delegate.read(buf, emptyOffset, buf.length - emptyOffset);
        if (read <= 0) {
          break;
        }
        bufLength += read;
      }
      if (x >= bufOffset + bufLength) {
        break;
      }
      int nc = buf[x];
      if (nc == 10)
      {
        int length = x - lineBufOffset + 1;
        bufOffset += length;
        bufLength -= length;
        offset += length;
        
        int stringLength = c == 13 ? length - 2 : length - 1;
        lineNumber += 1;
        return new String(buf, lineBufOffset, stringLength);
      }
      if (c == 13)
      {
        int length = x - lineBufOffset;
        bufOffset += length;
        bufLength -= length;
        offset += length;
        int stringLength = length - 1;
        lineNumber += 1;
        return new String(buf, lineBufOffset, stringLength);
      }
      c = nc;
    }
    if (bufLength > 0)
    {
      String line = new String(buf, bufOffset, c == 13 ? bufLength - 1 : bufLength);
      bufOffset = 0;
      offset += bufLength;
      bufLength = 0;
      lineNumber += 1;
      return line;
    }
    lineNumber += 1;
    return null;
  }
  
  public int getOffset()
  {
    return offset;
  }
  
  public int getLineOffset()
  {
    return lineOffset;
  }
  
  public int getLineNumber()
  {
    return lineNumber;
  }
}

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

import java.util.Set;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;

class ServiceLocator$2
  implements ServiceLocator.MarkupLanguageVisitor
{
  ServiceLocator$2(ServiceLocator paramServiceLocator, Set paramSet) {}
  
  public boolean accept(MarkupLanguage language)
  {
    val$markupLanguages.add(language);
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.wikitext.core.util.ServiceLocator.2
 * 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.StringReader;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

public class IgnoreDtdEntityResolver
  implements EntityResolver
{
  protected static final IgnoreDtdEntityResolver instance = new IgnoreDtdEntityResolver();
  
  public static IgnoreDtdEntityResolver getInstance()
  {
    return instance;
  }
  
  public InputSource resolveEntity(String publicId, String systemId)
    throws SAXException, IOException
  {
    if (((publicId != null) && (publicId.indexOf("//DTD") != -1)) || ((systemId != null) && (systemId.endsWith(".dtd")))) {
      return new InputSource(new StringReader(""));
    }
    return null;
  }
}

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

import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;

abstract interface ServiceLocator$MarkupLanguageVisitor
{
  public abstract boolean accept(MarkupLanguage paramMarkupLanguage);
}

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

import java.io.File;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.types.FileSet;
import org.eclipse.mylyn.wikitext.core.parser.builder.XslfoDocumentBuilder.Configuration;
import org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage;

public class MarkupToXslfoTask
  extends MarkupTask
{
  private final List<FileSet> filesets = new ArrayList();
  protected String xslfoFilenameFormat = "$1.fo";
  protected boolean overwrite = true;
  protected File file;
  protected File targetdir;
  private boolean generateBookmarks = true;
  private final XslfoDocumentBuilder.Configuration configuration = new XslfoDocumentBuilder.Configuration();
  
  public void execute()
    throws BuildException
  {
    if ((this.file == null) && (filesets.isEmpty())) {
      throw new BuildException(Messages.getString("MarkupToXslfoTask.0"));
    }
    if ((this.file != null) && (!filesets.isEmpty())) {
      throw new BuildException(Messages.getString("MarkupToXslfoTask.1"));
    }
    if (this.file != null)
    {
      if (!this.file.exists()) {
        throw new BuildException(MessageFormat.format(Messages.getString("MarkupToXslfoTask.2"), new Object[] { this.file }));
      }
      if (!this.file.isFile()) {
        throw new BuildException(MessageFormat.format(Messages.getString("MarkupToXslfoTask.3"), new Object[] { this.file }));
      }
      if (!this.file.canRead()) {
        throw new BuildException(MessageFormat.format(Messages.getString("MarkupToXslfoTask.4"), new Object[] { this.file }));
      }
    }
    MarkupLanguage markupLanguage = createMarkupLanguage();
    for (FileSet fileset : filesets)
    {
      File filesetBaseDir = fileset.getDir(getProject());
      DirectoryScanner ds = fileset.getDirectoryScanner(getProject());
      
      String[] files = ds.getIncludedFiles();
      if (files != null)
      {
        File baseDir = ds.getBasedir();
        String[] arrayOfString1;
        int j = (arrayOfString1 = files).length;
        for (int i = 0; i < j; i++)
        {
          String file = arrayOfString1[i];
          File inputFile = new File(baseDir, file);
          try
          {
            processFile(markupLanguage, filesetBaseDir, inputFile);
          }
          catch (BuildException e)
          {
            throw e;
          }
          catch (Exception e)
          {
            throw new BuildException(MessageFormat.format(
              Messages.getString("MarkupToXslfoTask.5"), new Object[] { inputFile, 
              e.getMessage() }), e);
          }
        }
      }
    }
    if (this.file != null) {
      try
      {
        processFile(markupLanguage, this.file.getParentFile(), this.file);
      }
      catch (BuildException e)
      {
        throw e;
      }
      catch (Exception e)
      {
        throw new BuildException(MessageFormat.format(
          Messages.getString("MarkupToXslfoTask.6"), new Object[] { this.file, e.getMessage() }), e);
      }
    }
  }
  
  /* Error */
  protected String processFile(MarkupLanguage markupLanguage, File baseDir, File source)
    throws BuildException
  {
    // Byte code:
    //   0: aload_0
    //   1: ldc 9
    //   3: invokestatic 424	org/eclipse/mylyn/wikitext/core/util/anttask/Messages:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   6: iconst_1
    //   7: anewarray 189	java/lang/Object
    //   10: dup
    //   11: iconst_0
    //   12: aload_3
    //   13: aastore
    //   14: invokestatic 364	java/text/MessageFormat:format	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   17: iconst_3
    //   18: invokevirtual 417	org/eclipse/mylyn/wikitext/core/util/anttask/MarkupToXslfoTask:log	(Ljava/lang/String;I)V
    //   21: aconst_null
    //   22: astore 4
    //   24: aload_3
    //   25: invokevirtual 354	java/io/File:getName	()Ljava/lang/String;
    //   28: astore 5
    //   30: aload 5
    //   32: bipush 46
    //   34: invokevirtual 361	java/lang/String:lastIndexOf	(I)I
    //   37: iconst_m1
    //   38: if_icmpeq +18 -> 56
    //   41: aload 5
    //   43: iconst_0
    //   44: aload 5
    //   46: bipush 46
    //   48: invokevirtual 361	java/lang/String:lastIndexOf	(I)I
    //   51: invokevirtual 362	java/lang/String:substring	(II)Ljava/lang/String;
    //   54: astore 5
    //   56: aload_0
    //   57: aload_3
    //   58: aload 5
    //   60: invokevirtual 422	org/eclipse/mylyn/wikitext/core/util/anttask/MarkupToXslfoTask:computeXslfoFile	(Ljava/io/File;Ljava/lang/String;)Ljava/io/File;
    //   63: astore 6
    //   65: aload_0
    //   66: getfield 344	org/eclipse/mylyn/wikitext/core/util/anttask/MarkupToXslfoTask:targetdir	Ljava/io/File;
    //   69: ifnull +21 -> 90
    //   72: new 184	java/io/File
    //   75: dup
    //   76: aload_0
    //   77: getfield 344	org/eclipse/mylyn/wikitext/core/util/anttask/MarkupToXslfoTask:targetdir	Ljava/io/File;
    //   80: aload 6
    //   82: invokevirtual 354	java/io/File:getName	()Ljava/lang/String;
    //   85: invokespecial 356	java/io/File:<init>	(Ljava/io/File;Ljava/lang/String;)V
    //   88: astore 6
    //   90: aload 6
    //   92: invokevirtual 351	java/io/File:exists	()Z
    //   95: ifeq +23 -> 118
    //   98: aload_0
    //   99: getfield 342	org/eclipse/mylyn/wikitext/core/util/anttask/MarkupToXslfoTask:overwrite	Z
    //   102: ifne +16 -> 118
    //   105: aload 6
    //   107: invokevirtual 349	java/io/File:lastModified	()J
    //   110: aload_3
    //   111: invokevirtual 349	java/io/File:lastModified	()J
    //   114: lcmp
    //   115: ifge +301 -> 416
    //   118: aload 4
    //   120: ifnonnull +10 -> 130
    //   123: aload_0
    //   124: aload_3
    //   125: invokevirtual 420	org/eclipse/mylyn/wikitext/core/util/anttask/MarkupToXslfoTask:readFully	(Ljava/io/File;)Ljava/lang/String;
    //   128: astore 4
    //   130: aload_0
    //   131: aload_3
    //   132: aload 4
    //   134: invokevirtual 421	org/eclipse/mylyn/wikitext/core/util/anttask/MarkupToXslfoTask:performValidation	(Ljava/io/File;Ljava/lang/String;)V
    //   137: new 186	java/io/OutputStreamWriter
    //   140: dup
    //   141: new 183	java/io/BufferedOutputStream
    //   144: dup
    //   145: new 185	java/io/FileOutputStream
    //   148: dup
    //   149: aload 6
    //   151: invokespecial 357	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
    //   154: invokespecial 348	java/io/BufferedOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   157: ldc 11
    //   159: invokespecial 358	java/io/OutputStreamWriter:<init>	(Ljava/io/OutputStream;Ljava/lang/String;)V
    //   162: astore 7
    //   164: goto +40 -> 204
    //   167: astore 8
    //   169: new 195	org/apache/tools/ant/BuildException
    //   172: dup
    //   173: ldc 10
    //   175: invokestatic 424	org/eclipse/mylyn/wikitext/core/util/anttask/Messages:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   178: iconst_2
    //   179: anewarray 189	java/lang/Object
    //   182: dup
    //   183: iconst_0
    //   184: aload 6
    //   186: aastore
    //   187: dup
    //   188: iconst_1
    //   189: aload 8
    //   191: invokevirtual 360	java/lang/Exception:getMessage	()Ljava/lang/String;
    //   194: aastore
    //   195: invokestatic 364	java/text/MessageFormat:format	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   198: aload 8
    //   200: invokespecial 367	org/apache/tools/ant/BuildException:<init>	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   203: athrow
    //   204: new 199	org/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder
    //   207: dup
    //   208: aload 7
    //   210: invokespecial 376	org/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder:<init>	(Ljava/io/Writer;)V
    //   213: astore 8
    //   215: aload_0
    //   216: getfield 347	org/eclipse/mylyn/wikitext/core/util/anttask/MarkupToXslfoTask:configuration	Lorg/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder$Configuration;
    //   219: invokevirtual 413	org/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder$Configuration:clone	()Lorg/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder$Configuration;
    //   222: astore 9
    //   224: aload 9
    //   226: invokevirtual 405	org/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder$Configuration:getTitle	()Ljava/lang/String;
    //   229: ifnonnull +10 -> 239
    //   232: aload 9
    //   234: aload 5
    //   236: invokevirtual 411	org/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder$Configuration:setTitle	(Ljava/lang/String;)V
    //   239: aload 8
    //   241: aload 9
    //   243: invokevirtual 378	org/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder:setConfiguration	(Lorg/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder$Configuration;)V
    //   246: aload 8
    //   248: aload_3
    //   249: invokevirtual 353	java/io/File:getParentFile	()Ljava/io/File;
    //   252: invokevirtual 355	java/io/File:toURI	()Ljava/net/URI;
    //   255: invokevirtual 377	org/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder:setBase	(Ljava/net/URI;)V
    //   258: new 198	org/eclipse/mylyn/wikitext/core/parser/MarkupParser
    //   261: dup
    //   262: invokespecial 372	org/eclipse/mylyn/wikitext/core/parser/MarkupParser:<init>	()V
    //   265: astore 10
    //   267: aload 10
    //   269: aload_1
    //   270: invokevirtual 375	org/eclipse/mylyn/wikitext/core/parser/MarkupParser:setMarkupLanguage	(Lorg/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage;)V
    //   273: aload 10
    //   275: aload 8
    //   277: invokevirtual 374	org/eclipse/mylyn/wikitext/core/parser/MarkupParser:setBuilder	(Lorg/eclipse/mylyn/wikitext/core/parser/DocumentBuilder;)V
    //   280: aload_0
    //   281: getfield 341	org/eclipse/mylyn/wikitext/core/util/anttask/MarkupToXslfoTask:generateBookmarks	Z
    //   284: ifeq +25 -> 309
    //   287: new 201	org/eclipse/mylyn/wikitext/core/parser/outline/OutlineParser
    //   290: dup
    //   291: aload_1
    //   292: invokespecial 414	org/eclipse/mylyn/wikitext/core/parser/outline/OutlineParser:<init>	(Lorg/eclipse/mylyn/wikitext/core/parser/markup/MarkupLanguage;)V
    //   295: aload 4
    //   297: invokevirtual 415	org/eclipse/mylyn/wikitext/core/parser/outline/OutlineParser:parse	(Ljava/lang/String;)Lorg/eclipse/mylyn/wikitext/core/parser/outline/OutlineItem;
    //   300: astore 11
    //   302: aload 8
    //   304: aload 11
    //   306: invokevirtual 379	org/eclipse/mylyn/wikitext/core/parser/builder/XslfoDocumentBuilder:setOutline	(Lorg/eclipse/mylyn/wikitext/core/parser/outline/OutlineItem;)V
    //   309: aload 10
    //   311: aload 4
    //   313: invokevirtual 373	org/eclipse/mylyn/wikitext/core/parser/MarkupParser:parse	(Ljava/lang/String;)V
    //   316: goto +54 -> 370
    //   319: astore 12
    //   321: aload 7
    //   323: invokevirtual 359	java/io/Writer:close	()V
    //   326: goto +41 -> 367
    //   329: astore 13
    //   331: new 195	org/apache/tools/ant/BuildException
    //   334: dup
    //   335: ldc_w 182
    //   338: invokestatic 424	org/eclipse/mylyn/wikitext/core/util/anttask/Messages:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   341: iconst_2
    //   342: anewarray 189	java/lang/Object
    //   345: dup
    //   346: iconst_0
    //   347: aload 6
    //   349: aastore
    //   350: dup
    //   351: iconst_1
    //   352: aload 13
    //   354: invokevirtual 360	java/lang/Exception:getMessage	()Ljava/lang/String;
    //   357: aastore
    //   358: invokestatic 364	java/text/MessageFormat:format	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   361: aload 13
    //   363: invokespecial 367	org/apache/tools/ant/BuildException:<init>	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   366: athrow
    //   367: aload 12
    //   369: athrow
    //   370: aload 7
    //   372: invokevirtual 359	java/io/Writer:close	()V
    //   375: goto +41 -> 416
    //   378: astore 13
    //   380: new 195	org/apache/tools/ant/BuildException
    //   383: dup
    //   384: ldc_w 182
    //   387: invokestatic 424	org/eclipse/mylyn/wikitext/core/util/anttask/Messages:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   390: iconst_2
    //   391: anewarray 189	java/lang/Object
    //   394: dup
    //   395: iconst_0
    //   396: aload 6
    //   398: aastore
    //   399: dup
    //   400: iconst_1
    //   401: aload 13
    //   403: invokevirtual 360	java/lang/Exception:getMessage	()Ljava/lang/String;
    //   406: aastore
    //   407: invokestatic 364	java/text/MessageFormat:format	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   410: aload 13
    //   412: invokespecial 367	org/apache/tools/ant/BuildException:<init>	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   415: athrow
    //   416: aload 4
    //   418: areturn
    // Line number table:
    //   Java source line #118	-> byte code offset #0
    //   Java source line #120	-> byte code offset #21
    //   Java source line #122	-> byte code offset #24
    //   Java source line #123	-> byte code offset #30
    //   Java source line #124	-> byte code offset #41
    //   Java source line #127	-> byte code offset #56
    //   Java source line #128	-> byte code offset #65
    //   Java source line #129	-> byte code offset #72
    //   Java source line #131	-> byte code offset #90
    //   Java source line #133	-> byte code offset #118
    //   Java source line #134	-> byte code offset #123
    //   Java source line #137	-> byte code offset #130
    //   Java source line #141	-> byte code offset #137
    //   Java source line #142	-> byte code offset #167
    //   Java source line #143	-> byte code offset #169
    //   Java source line #144	-> byte code offset #173
    //   Java source line #143	-> byte code offset #195
    //   Java source line #144	-> byte code offset #198
    //   Java source line #143	-> byte code offset #200
    //   Java source line #147	-> byte code offset #204
    //   Java source line #148	-> byte code offset #215
    //   Java source line #149	-> byte code offset #224
    //   Java source line #150	-> byte code offset #232
    //   Java source line #152	-> byte code offset #239
    //   Java source line #153	-> byte code offset #246
    //   Java source line #155	-> byte code offset #258
    //   Java source line #156	-> byte code offset #267
    //   Java source line #157	-> byte code offset #273
    //   Java source line #159	-> byte code offset #280
    //   Java source line #160	-> byte code offset #287
    //   Java source line #161	-> byte code offset #302
    //   Java source line #164	-> byte code offset #309
    //   Java source line #165	-> byte code offset #319
    //   Java source line #167	-> byte code offset #321
    //   Java source line #168	-> byte code offset #329
    //   Java source line #169	-> byte code offset #331
    //   Java source line #170	-> byte code offset #335
    //   Java source line #171	-> byte code offset #352
    //   Java source line #169	-> byte code offset #358
    //   Java source line #171	-> byte code offset #361
    //   Java source line #169	-> byte code offset #363
    //   Java source line #173	-> byte code offset #367
    //   Java source line #167	-> byte code offset #370
    //   Java source line #168	-> byte code offset #378
    //   Java source line #169	-> byte code offset #380
    //   Java source line #170	-> byte code offset #384
    //   Java source line #171	-> byte code offset #401
    //   Java source line #169	-> byte code offset #407
    //   Java source line #171	-> byte code offset #410
    //   Java source line #169	-> byte code offset #412
    //   Java source line #175	-> byte code offset #416
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	419	0	this	MarkupToXslfoTask
    //   0	419	1	markupLanguage	MarkupLanguage
    //   0	419	2	baseDir	File
    //   0	419	3	source	File
    //   22	395	4	markupContent	String
    //   28	207	5	name	String
    //   63	334	6	outputFile	File
    //   162	3	7	out	java.io.Writer
    //   204	167	7	out	java.io.Writer
    //   167	32	8	e	Exception
    //   213	90	8	builder	org.eclipse.mylyn.wikitext.core.parser.builder.XslfoDocumentBuilder
    //   222	20	9	configuration	XslfoDocumentBuilder.Configuration
    //   265	45	10	parser	org.eclipse.mylyn.wikitext.core.parser.MarkupParser
    //   300	5	11	outline	org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem
    //   319	49	12	localObject	Object
    //   329	33	13	e	Exception
    //   378	33	13	e	Exception
    // Exception table:
    //   from	to	target	type
    //   137	164	167	java/lang/Exception
    //   204	319	319	finally
    //   321	326	329	java/lang/Exception
    //   370	375	378	java/lang/Exception
  }
  
  protected File computeXslfoFile(File source, String name)
  {
    return new File(source.getParentFile(), xslfoFilenameFormat.replace("$1", name));
  }
  
  public String getXslfoFilenameFormat()
  {
    return xslfoFilenameFormat;
  }
  
  public void setXslfoFilenameFormat(String filenameFormat)
  {
    xslfoFilenameFormat = filenameFormat;
  }
  
  public File getFile()
  {
    return file;
  }
  
  public void setFile(File file)
  {
    this.file = file;
  }
  
  public void addFileset(FileSet set)
  {
    filesets.add(set);
  }
  
  public File getTargetdir()
  {
    return targetdir;
  }
  
  public void setTargetdir(File targetdir)
  {
    this.targetdir = targetdir;
  }
  
  public String getAuthor()
  {
    return configuration.getAuthor();
  }
  
  public String getCopyright()
  {
    return configuration.getCopyright();
  }
  
  public String getDate()
  {
    return configuration.getDate();
  }
  
  public float getFontSize()
  {
    return configuration.getFontSize();
  }
  
  public float[] getFontSizeMultipliers()
  {
    return configuration.getFontSizeMultipliers();
  }
  
  public float getPageHeight()
  {
    return configuration.getPageHeight();
  }
  
  public float getPageMargin()
  {
    return configuration.getPageMargin();
  }
  
  public float getPageWidth()
  {
    return configuration.getPageWidth();
  }
  
  public String getSubTitle()
  {
    return configuration.getSubTitle();
  }
  
  public String getTitle()
  {
    return configuration.getTitle();
  }
  
  public String getVersion()
  {
    return configuration.getVersion();
  }
  
  public boolean isPageBreakOnHeading1()
  {
    return configuration.isPageBreakOnHeading1();
  }
  
  public boolean isPageNumbering()
  {
    return configuration.isPageNumbering();
  }
  
  public boolean isPanelText()
  {
    return configuration.isPanelText();
  }
  
  public boolean isShowExternalLinks()
  {
    return configuration.isShowExternalLinks();
  }
  
  public boolean isUnderlineLinks()
  {
    return configuration.isUnderlineLinks();
  }
  
  public void setAuthor(String author)
  {
    configuration.setAuthor(author);
  }
  
  public void setCopyright(String copyright)
  {
    configuration.setCopyright(copyright);
  }
  
  public void setDate(String date)
  {
    configuration.setDate(date);
  }
  
  public void setFontSize(float fontSize)
  {
    configuration.setFontSize(fontSize);
  }
  
  public void setFontSizeMultipliers(float[] fontSizeMultipliers)
  {
    configuration.setFontSizeMultipliers(fontSizeMultipliers);
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