本文整理汇总了Java中org.databene.commons.OrderedMap类的典型用法代码示例。如果您正苦于以下问题:Java OrderedMap类的具体用法?Java OrderedMap怎么用?Java OrderedMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OrderedMap类属于org.databene.commons包,在下文中一共展示了OrderedMap类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateTable
import org.databene.commons.OrderedMap; //导入依赖的package包/类
private void generateTable(InstanceDescriptor descriptor, LFNormalizingStringBuilder writer) {
ComplexTypeDescriptor type = (ComplexTypeDescriptor) descriptor.getTypeDescriptor();
Map<String, String> attributes = new OrderedMap<String, String>();
for (FeatureDetail<? extends Object> detail : descriptor.getDetails()) {
Object value = detail.getValue();
if (value != null && !isDefaultValue(value, detail.getName())) {
if (value instanceof Expression)
value = ((Expression<?>) value).evaluate(null);
attributes.put(detail.getName(), toStringConverter.convert(value));
}
}
attributes.put(ATT_CONSUMER, "db");
appendStartTag(EL_GENERATE, attributes, writer, false);
writer.append('\n');
for (ComponentDescriptor cd : type.getComponents())
addAttribute(cd, writer);
writer.append(TAB);
appendEndElement(EL_GENERATE, writer);
writer.append("\n\n").append(TAB);
}
示例2: saveState
import org.databene.commons.OrderedMap; //导入依赖的package包/类
private void saveState() {
try {
FileUtil.ensureDirectoryExists(new File(DATABENE_DIRECTORY_NAME));
Map<String, String> props = new OrderedMap<String, String>();
props.put("exclusionPattern", exclusionField.getText());
IOUtil.writeProperties(props, GUI_PROPERTIES_FILE_NAME);
} catch (IOException e) {
// writing the file failed but isn't tragic
}
}
示例3: getFeatures
import org.databene.commons.OrderedMap; //导入依赖的package包/类
/** Provides a {@link Map} of all properties and public attributes of a class assigned to their Java type.
* @param type the Java class to examine
* @return a {@link Map} of all properties and public attributes of a class assigned to their Java type */
public static Map<String, Class<?>> getFeatures(Class<?> type) {
Map<String, Class<?>> features = new OrderedMap<String, Class<?>>();
for (Field field : type.getDeclaredFields()) {
if (WizardUtil.isPublic(field) || BeanUtil.hasProperty(type, field.getName())) {
features.put(field.getName(), field.getType());
}
}
return features;
}
示例4: getOrCreateIdMapForType
import org.databene.commons.OrderedMap; //导入依赖的package包/类
private Map<Object, Entity> getOrCreateIdMapForType(String entityType) {
Map<Object, Entity> idMap = typeMap.get(entityType);
if (idMap == null) {
idMap = new OrderedMap<Object, Entity>();
typeMap.put(entityType, idMap);
}
return idMap;
}
示例5: ConnectionHolder
import org.databene.commons.OrderedMap; //导入依赖的package包/类
public ConnectionHolder(DBSystem db) {
this.insertStatements = new OrderedMap<ComplexTypeDescriptor, PreparedStatement>();
this.updateStatements = new OrderedMap<ComplexTypeDescriptor, PreparedStatement>();
this.selectByPKStatements = new OrderedMap<ComplexTypeDescriptor, PreparedStatement>();
this.db = db;
this.connection = null; // lazily initialized
}
示例6: State
import org.databene.commons.OrderedMap; //导入依赖的package包/类
public State(String id) {
this.id = id;
this.cities = new OrderedMap<CityId, City>();
}