📄 mappingrules.java
字号:
package net.betterjava.sample.xml.bind;
import java.util.ListIterator;
import java.util.Map;
import java.util.List;
import java.util.Collection;
import org.w3c.dom.Node;
/**
* a pluggable interface that is used to determine the duplicated BL data name
* mapping
*/
public interface MappingRules {
/**
* check the properties of field which name is argument field and map to node
* before you try to get a field's properties, such as if it's duplicated, is multiple value,
* and the count of this field, etc. You must invoke his method first,This method don't read
* read data, but it indeed switch the data page.
* null fieldName will throw a NullPointerException, node can be null as some properties can
* be get without node information.
* @param field java.lang.String
* @param node org.w3c.dom.Node
*/
public abstract MappingRulesConstants checkField(
String fieldName,
Node node,
int index,
int parentIndex);
/**
* clean any expensive resource
*/
void cleanup();
/**
* return the amout of Copy and page.
* @return int
* @param name java.lang.String the name of the xml element
* map to copy or page controlfield.
*/
public abstract int getControlFieldCount(String name);
/**
* get the index of current process data
* @return int the index of current field, the return
* value +1 is the index of current field value
*/
public abstract int getCurrentPosition();
/**
* get the data
* @return List A list representation of data string with
* data moved. About the data move, pls. refer design document.
*/
public List getData();
/**
* get the root element name of schema
* @return String the name of root element of schema, such as "BL"
*/
public abstract String getRoot();
/**
* if field is duplicated, return the mapped value, else return
* MappingRulesConstants.NoMappedValue.
*
* @param fieldName
* @param data
* @param schemaNode
* @return String
* @roseuid 3CDC153C0242
*/
public abstract String getSingleMappedValue();
/**
* set the data string
*/
public abstract void setData(String data) throws WrongFormatException;
/**
* set the data parser
*/
public abstract void setDataParser(DataParser aParser);
/**
* set the class implement Logger interface
*/
public abstract void setLogger(Logger newTheLogger);
/**
* set the schema object, this is an optional method
*/
public abstract void setSchema(Object newSchema);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -