public class ViewsDisplayFactory extends Object
ViewsDisplayFactory class.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
initialized
Boolean indicating if the init() method has been called.
|
protected long |
m_lastModified
Timestamp of the viewDisplay file, used to know when to reload from disk.
|
protected File |
m_viewsDisplayFile
File path of groups.xml.
|
protected Map<String,View> |
m_viewsMap
Map of view objects by name.
|
| Constructor and Description |
|---|
ViewsDisplayFactory(String file)
Constructor for ViewsDisplayFactory.
|
| Modifier and Type | Method and Description |
|---|---|
View |
getDefaultView()
getDefaultView
|
int |
getDisconnectTimeout()
getDisconnectTimeout
|
static ViewsDisplayFactory |
getInstance()
Singleton static call to get the only instance that should exist for the
ViewsDisplayFactory
|
View |
getView(String viewName)
Can be null
|
File |
getViewsDisplayFile()
getViewsDisplayFile
|
static void |
init()
Be sure to call this method before calling getInstance().
|
void |
reload()
Parses the viewsdisplay.xml
|
static void |
setInstance(ViewsDisplayFactory instance)
setInstance
|
void |
setViewsDisplayFile(File viewsDisplayFile)
setViewsDisplayFile
|
protected void |
updateFromFile()
Reload the viewsdisplay.xml file if it has been changed since we last
read it.
|
protected File m_viewsDisplayFile
protected boolean initialized
protected long m_lastModified
public ViewsDisplayFactory(String file) throws FileNotFoundException, IOException
Constructor for ViewsDisplayFactory.
file - a String object.FileNotFoundException - if any.IOException - if any.public static void init()
throws IOException,
FileNotFoundException
IOException - if any.FileNotFoundException - if any.public static ViewsDisplayFactory getInstance()
IllegalStateException - if init has not been calledpublic void reload()
throws IOException,
FileNotFoundException
IOException - if any.FileNotFoundException - if any.public void setViewsDisplayFile(File viewsDisplayFile)
setViewsDisplayFile
viewsDisplayFile - a File object.public File getViewsDisplayFile() throws IOException
getViewsDisplayFile
File object.IOException - if any.public View getView(String viewName) throws IOException
viewName - a String object.View object.IOException - if any.protected void updateFromFile()
throws IOException
IOException - if any.public static void setInstance(ViewsDisplayFactory instance)
setInstance
instance - a ViewsDisplayFactory object.public int getDisconnectTimeout()
getDisconnectTimeout
Copyright © 2022. All rights reserved.