
xworker.dataObject.DataObjectThingUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xworker_dataobject Show documentation
Show all versions of xworker_dataobject Show documentation
DataObject is a data mapping model.
/*******************************************************************************
* Copyright 2007-2013 See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package xworker.dataObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.xmeta.Thing;
public class DataObjectThingUtils {
/**
* 获取关键字段的定义列表。
*
* @param dataObject
* @return 关键字属性事物列表
*/
public static List getKeyAttributes(Thing dataObject){
List keys = new ArrayList();
for(Thing attribute : dataObject.getChilds("attribute")){
if(attribute.getBoolean("key")){
keys.add(attribute);
}
}
//def firstAttribute = self.getThing("attribute@0");
//if(keys.size() == 0 && firstAttribute){
// keys.add(firstAttribute);
//}
return keys;
}
/**
* 获取编辑属性。
*
* @param self 事物
* @param editorType 编辑类型
* @return 要编辑的属性列表
*/
public static List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy