public abstract class AbstractFileProcessor extends Object implements FileProcessor
Modifier and Type | Field and Description |
---|---|
protected XmlNode |
applicationConfig |
protected Map<String,Object> |
caches |
protected List<FileObject> |
changeList |
protected XmlNode |
componentConfig |
protected List<FileObject> |
deleteList |
protected List<FileObject> |
fileObjects |
protected FileResolver |
fileResolver |
protected static Logger |
LOGGER |
DEFAULT_PRECEDENCE, HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
AbstractFileProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
add(FileObject fileObject)
为文件处理器新增文件对象
|
protected abstract boolean |
checkMatch(FileObject fileObject) |
void |
clean()
处理完成后执行
|
void |
config(XmlNode applicationConfig,
XmlNode componentConfig)
设置配置信息,应用配置和组件配置内容合并
|
protected <T> T |
convertFromXml(com.thoughtworks.xstream.XStream stream,
FileObject fileObject)
转换XML为Xstream对象
|
void |
delete(FileObject fileObject)
文件删除时的处理
|
XmlNode |
getApplicationConfig()
获取应用配置信息
|
String |
getApplicationNodePath()
获取在application.xml中配置对象的相对路径
|
XmlNode |
getComponentConfig()
获取组件配置信息
|
String |
getComponentConfigPath()
返回该配置对象组件配置的相对路径,相对于classpath的路径。
|
FileResolver |
getFileResolver() |
int |
getOrder()
Return the order value of this object, with a
higher value meaning greater in terms of sorting.
|
boolean |
isMatch(FileObject fileObject)
该文件处理器是否可以处理该文件对象
|
void |
modify(FileObject fileObject)
文件修改后的处理
|
void |
noChange(FileObject fileObject)
文件内容没有变化的处理
|
void |
setFileResolver(FileResolver fileResolver)
设置文件搜索器
|
boolean |
supportRefresh()
是否支持刷新
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
process
protected static final Logger LOGGER
protected List<FileObject> fileObjects
protected List<FileObject> changeList
protected List<FileObject> deleteList
protected FileResolver fileResolver
protected XmlNode applicationConfig
protected XmlNode componentConfig
public boolean isMatch(FileObject fileObject)
FileProcessor
isMatch
in interface FileProcessor
protected abstract boolean checkMatch(FileObject fileObject)
public FileResolver getFileResolver()
public void setFileResolver(FileResolver fileResolver)
FileProcessor
setFileResolver
in interface FileProcessor
fileResolver
- 文件搜索器public void add(FileObject fileObject)
FileProcessor
add
in interface FileProcessor
fileObject
- 文件对象public void noChange(FileObject fileObject)
FileProcessor
noChange
in interface FileProcessor
fileObject
- 文件对象public void modify(FileObject fileObject)
FileProcessor
modify
in interface FileProcessor
fileObject
- 文件对象public void delete(FileObject fileObject)
FileProcessor
delete
in interface FileProcessor
fileObject
- 文件对象public void clean()
FileProcessor
clean
in interface FileProcessor
public boolean supportRefresh()
FileProcessor
supportRefresh
in interface FileProcessor
public String getApplicationNodePath()
Configuration
getApplicationNodePath
in interface Configuration
public String getComponentConfigPath()
Configuration
getComponentConfigPath
in interface Configuration
public void config(XmlNode applicationConfig, XmlNode componentConfig)
Configuration
config
in interface Configuration
applicationConfig
- 应用配置节点componentConfig
- 组件配置节点public XmlNode getComponentConfig()
Configuration
getComponentConfig
in interface Configuration
public XmlNode getApplicationConfig()
Configuration
getApplicationConfig
in interface Configuration
public int getOrder()
Ordered
Normally starting with 0 or 1, with Ordered.LOWEST_PRECEDENCE
indicating greatest. Same order values will result in arbitrary
positions for the affected objects.
Higher value can be interpreted as lower priority, consequently the first object has highest priority (somewhat analogous to Servlet "load-on-startup" values).
Note that order values below 0 are reserved for framework purposes. Application-specified values should always be 0 or greater, with only framework components (internal or third-party) supposed to use lower values.
getOrder
in interface Ordered
Ordered.LOWEST_PRECEDENCE
protected <T> T convertFromXml(com.thoughtworks.xstream.XStream stream, FileObject fileObject)
T
- stream
- fileObject
- Copyright © 2006–2018 TinyGroup. All rights reserved.