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, waitprocessprotected 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)
FileProcessorisMatch in interface FileProcessorprotected abstract boolean checkMatch(FileObject fileObject)
public FileResolver getFileResolver()
public void setFileResolver(FileResolver fileResolver)
FileProcessorsetFileResolver in interface FileProcessorfileResolver - 文件搜索器public void add(FileObject fileObject)
FileProcessoradd in interface FileProcessorfileObject - 文件对象public void noChange(FileObject fileObject)
FileProcessornoChange in interface FileProcessorfileObject - 文件对象public void modify(FileObject fileObject)
FileProcessormodify in interface FileProcessorfileObject - 文件对象public void delete(FileObject fileObject)
FileProcessordelete in interface FileProcessorfileObject - 文件对象public void clean()
FileProcessorclean in interface FileProcessorpublic boolean supportRefresh()
FileProcessorsupportRefresh in interface FileProcessorpublic String getApplicationNodePath()
ConfigurationgetApplicationNodePath in interface Configurationpublic String getComponentConfigPath()
ConfigurationgetComponentConfigPath in interface Configurationpublic void config(XmlNode applicationConfig, XmlNode componentConfig)
Configurationconfig in interface ConfigurationapplicationConfig - 应用配置节点componentConfig - 组件配置节点public XmlNode getComponentConfig()
ConfigurationgetComponentConfig in interface Configurationpublic XmlNode getApplicationConfig()
ConfigurationgetApplicationConfig in interface Configurationpublic int getOrder()
OrderedNormally 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 OrderedOrdered.LOWEST_PRECEDENCEprotected <T> T convertFromXml(com.thoughtworks.xstream.XStream stream,
FileObject fileObject)
T - stream - fileObject - Copyright © 2006–2018 TinyGroup. All rights reserved.