public abstract class AbstractPathTopicMapSource extends Object implements TopicMapSourceIF, FileFilter
Modifier and Type | Field and Description |
---|---|
protected LocatorIF |
base_address |
protected boolean |
duplicate_suppression |
protected boolean |
hidden |
protected String |
id |
protected String |
path |
protected Map<String,TopicMapReferenceIF> |
refmap |
protected String |
suffix |
protected String |
title |
Constructor and Description |
---|
AbstractPathTopicMapSource() |
AbstractPathTopicMapSource(String path,
FileFilter filter) |
AbstractPathTopicMapSource(String path,
FileFilter filter,
LocatorIF base_address) |
AbstractPathTopicMapSource(String path,
String suffix) |
AbstractPathTopicMapSource(String path,
String suffix,
LocatorIF base_address) |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(File file)
INTERNAL: A file filter method implementation.
|
void |
close()
PUBLIC: Closes the source by releasing references it holds to e.g.
|
protected TopicMapReferenceIF |
createReference(URL url,
String id,
String title) |
protected abstract TopicMapReferenceIF |
createReference(URL url,
String id,
String title,
LocatorIF base_address) |
TopicMapReferenceIF |
createTopicMap(String name,
String baseAddress)
PUBLIC: Creates a new topic map in the underlying source
and returns a reference to the created topic map.
|
LocatorIF |
getBase()
INTERNAL: Gets the base locator of the topic maps retrieved from
the source.
|
String |
getBaseAddress()
INTERNAL: Gets the base address of the topic maps retrieved from
the source.
|
boolean |
getDuplicateSuppression()
INTERNAL: Gets the duplicate suppression flag.
|
FileFilter |
getFileFilter()
INTERNAL: Returns the FileFilter used to in the specified
path.
|
boolean |
getHidden() |
String |
getId()
PUBLIC: Gets the id of the source.
|
String |
getPath()
INTERNAL: Gets the path in which the source locates its references.
|
Collection<TopicMapReferenceIF> |
getReferences()
PUBLIC: Returns an unmodifiable collection of
TopicMapReferenceIF s found by the topic map source. |
String |
getSuffix()
INTERNAL: Gets the file suffix that should be used for filtering.
|
String |
getTitle()
PUBLIC: Gets the title of the source.
|
void |
refresh()
PUBLIC: Refreshes the collection of references.
|
protected Map |
refreshFromClasspath() |
protected Map<String,TopicMapReferenceIF> |
refreshFromFilesystem() |
void |
setBase(LocatorIF base_address)
INTERNAL: Sets the base locator of the topic maps retrieved from
the source.
|
void |
setBaseAddress(String base_address)
INTERNAL: Sets the base address of the topic maps retrieved from
the source.
|
void |
setDuplicateSuppression(boolean duplicate_suppression)
INTERNAL: Sets the duplicate suppression flag.
|
void |
setFileFilter(FileFilter filter)
INTERNAL: Sets a FileFilter used to filter the files in the
specified path.
|
void |
setHidden(boolean hidden) |
void |
setId(String id)
PUBLIC: Sets the id of the source.
|
void |
setPath(String path)
INTERNAL: Sets the path in which the source locates its references.
|
void |
setSuffix(String suffix)
INTERNAL: Sets the file suffix that should be used for filtering.
|
void |
setTitle(String title)
PUBLIC: Sets the title of the source.
|
boolean |
supportsCreate()
PUBLIC: Returns true if the source supports creating new
topic maps with the createTopicMap.
|
boolean |
supportsDelete()
PUBLIC: Returns true if the source supports deleting topic map
with the TopicMapReferenceIF.delete() method.
|
protected String id
protected String title
protected String path
protected String suffix
protected LocatorIF base_address
protected boolean duplicate_suppression
protected boolean hidden
protected Map<String,TopicMapReferenceIF> refmap
public AbstractPathTopicMapSource()
public AbstractPathTopicMapSource(String path, FileFilter filter)
public AbstractPathTopicMapSource(String path, String suffix, LocatorIF base_address)
public AbstractPathTopicMapSource(String path, FileFilter filter, LocatorIF base_address)
public String getId()
TopicMapSourceIF
getId
in interface TopicMapSourceIF
public void setId(String id)
TopicMapSourceIF
UnsupportedOperationException
if it does not support
setting the id.setId
in interface TopicMapSourceIF
public String getTitle()
TopicMapSourceIF
getTitle
in interface TopicMapSourceIF
public void setTitle(String title)
TopicMapSourceIF
setTitle
in interface TopicMapSourceIF
public String getPath()
public void setPath(String path)
public String getSuffix()
public void setSuffix(String suffix)
public LocatorIF getBase()
public void setBase(LocatorIF base_address)
public String getBaseAddress()
public void setBaseAddress(String base_address)
public boolean getDuplicateSuppression()
public void setDuplicateSuppression(boolean duplicate_suppression)
public Collection<TopicMapReferenceIF> getReferences()
TopicMapSourceIF
TopicMapReferenceIF
s found by the topic map source.getReferences
in interface TopicMapSourceIF
public boolean supportsCreate()
TopicMapSourceIF
supportsCreate
in interface TopicMapSourceIF
public boolean supportsDelete()
TopicMapSourceIF
supportsDelete
in interface TopicMapSourceIF
public TopicMapReferenceIF createTopicMap(String name, String baseAddress)
TopicMapSourceIF
createTopicMap
in interface TopicMapSourceIF
public void refresh()
TopicMapSourceIF
refresh
in interface TopicMapSourceIF
public void close()
TopicMapSourceIF
close
in interface AutoCloseable
close
in interface TopicMapSourceIF
protected Map<String,TopicMapReferenceIF> refreshFromFilesystem()
protected Map refreshFromClasspath()
protected TopicMapReferenceIF createReference(URL url, String id, String title)
protected abstract TopicMapReferenceIF createReference(URL url, String id, String title, LocatorIF base_address)
public FileFilter getFileFilter()
public void setFileFilter(FileFilter filter)
filter
- a java.io.FileFilter object for filtering the filespublic boolean accept(File file)
accept
in interface FileFilter
public boolean getHidden()
public void setHidden(boolean hidden)