org.onemind.jxp
Class MultiSourcePageSource

java.lang.Object
  extended by org.onemind.jxp.JxpPageSource
      extended by org.onemind.jxp.MultiSourcePageSource

public class MultiSourcePageSource
extends JxpPageSource

A PageSource containing multiple page sources

Author:
TiongHiang Lee (thlee@onemindsoft.org)

Field Summary
private  java.util.List _sources
          the sources
 
Constructor Summary
MultiSourcePageSource()
          Constructor
 
Method Summary
 void addPageSource(JxpPageSource source)
          Add a new page source
 java.lang.StringBuffer getErrorSource(JxpPage page, int line, int col)
          Print the error source of this page on given line and column
 AstJxpDocument getJxpDocument(JxpPage page)
          Get the jxp document for the JxpPage
 JxpPage getJxpPage(java.lang.String id)
          Return a jxp page identified by the id
 java.util.List getPageSources()
          Get the page sources
 boolean hasJxpPage(java.lang.String id)
          Return whether the jxp page identified by the id exists
 void removePageSource(JxpPageSource source)
          Remove the page source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sources

private java.util.List _sources
the sources

Constructor Detail

MultiSourcePageSource

public MultiSourcePageSource()
Constructor

Method Detail

addPageSource

public final void addPageSource(JxpPageSource source)
Add a new page source

Parameters:
source - the page source

removePageSource

public final void removePageSource(JxpPageSource source)
Remove the page source

Parameters:
source - the source

getPageSources

public final java.util.List getPageSources()
Get the page sources

Returns:
the sources

getJxpPage

public final JxpPage getJxpPage(java.lang.String id)
                         throws JxpPageNotFoundException
Return a jxp page identified by the id

Specified by:
getJxpPage in class JxpPageSource
Parameters:
id - the id
Returns:
the jxp page
Throws:
JxpPageNotFoundException - if the page cannot be found

getErrorSource

public final java.lang.StringBuffer getErrorSource(JxpPage page,
                                                   int line,
                                                   int col)
                                            throws java.io.IOException
Print the error source of this page on given line and column

Specified by:
getErrorSource in class JxpPageSource
Parameters:
page - the page
line - the line
col - the column
Returns:
the StringBuffer
Throws:
java.io.IOException - if there's IO problem

getJxpDocument

public final AstJxpDocument getJxpDocument(JxpPage page)
                                    throws JxpPageSourceException
Get the jxp document for the JxpPage

Specified by:
getJxpDocument in class JxpPageSource
Parameters:
page - the JxpPage
Returns:
the AstJxpDocument
Throws:
JxpPageSourceException - if there's source exception

hasJxpPage

public boolean hasJxpPage(java.lang.String id)
Return whether the jxp page identified by the id exists

Specified by:
hasJxpPage in class JxpPageSource
Parameters:
id - the id
Returns:
true if exists