赞
踩
本文整理匯總了Java中io.github.ibuildthecloud.gdapi.model.Schema.getParent方法的典型用法代碼示例。如果您正苦於以下問題:Java Schema.getParent方法的具體用法?Java Schema.getParent怎麽用?Java Schema.getParent使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.github.ibuildthecloud.gdapi.model.Schema的用法示例。
在下文中一共展示了Schema.getParent方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: parseSchemas
點讚 3
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
protected void parseSchemas(List schemas) {
Set done = new HashSet<>();
List todo = new ArrayList<>(schemas);
do {
int todoSize = todo.size();
Iterator iter = todo.iterator();
while (iter.hasNext()) {
Schema schema = iter.next();
if (schema.getParent() == null || done.contains(schema.getParent())) {
schemaFactory.parseSchema(schema.getId());
done.add(schema.getId());
iter.remove();
}
}
if (todo.size() > 0 && todo.size() == todoSize) {
throw new IllegalStateException("Failed to find parents of schemas " + todo);
}
} while (todo.size() > 0);
}
開發者ID:rancher,項目名稱:cattle,代碼行數:23,
示例2: getType
點讚 3
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
@Override
public String getType(Object obj) {
if (obj == null) {
return null;
}
Schema schema;
if (obj instanceof Class>) {
schema = schemaFactory.getSchema((Class>) obj);
} else if (obj instanceof String) {
schema = schemaFactory.getSchema(obj.toString());
} else {
schema = schemaFactory.getSchema(obj.getClass());
}
if (schema == null) {
return null;
}
return schema.getParent() == null ? schema.getId() : schemaFactory.getBaseType(schema.getId());
}
開發者ID:rancher,項目名稱:cattle,代碼行數:21,
示例3: getBaseType
點讚 3
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
@Override
public String getBaseType(String type) {
Schema schema = getSchema(type);
if (schema == null) {
return null;
}
while (schema.getParent() != null) {
Schema parent = getSchema(schema.getParent());
if (parent == null) {
return null;
}
schema = parent;
}
return schema.getId();
}
開發者ID:rancher,項目名稱:cattle,代碼行數:18,
示例4: parseSchemas
點讚 3
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
protected void parseSchemas(List schemas) {
Set done = new HashSet();
List todo = new ArrayList(schemas);
do {
int todoSize = todo.size();
Iterator iter = todo.iterator();
while ( iter.hasNext() ) {
Schema schema = iter.next();
if ( schema.getParent() == null || done.contains(schema.getParent()) ) {
schemaFactory.parseSchema(schema.getId());
done.add(schema.getId());
iter.remove();
}
}
if ( todo.size() > 0 && todo.size() == todoSize ) {
throw new IllegalStateException("Failed to find parents of schemas " + todo);
}
} while ( todo.size() > 0 );
}
開發者ID:cloudnautique,項目名稱:cloud-cattle,代碼行數:23,
示例5: getType
點讚 3
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
@Override
public String getType(Object obj) {
if ( obj == null ) {
return null;
}
Schema schema = null;
if ( obj instanceof Class> ) {
schema = schemaFactory.getSchema((Class>)obj);
} else {
schema = schemaFactory.getSchema(obj.getClass());
}
if ( schema == null ) {
return null;
}
return schema.getParent() == null ? schema.getId () : schemaFactory.getBaseType(schema.getId());
}
開發者ID:cloudnautique,項目名稱:cloud-cattle,代碼行數:19,
示例6: getClassForType
點讚 2
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
protected Class> getClassForType(SchemaFactory schemaFactory, String type) {
Class> clz = schemaFactory.getSchemaClass(type);
if (clz == null) {
Schema schema = schemaFactory.getSchema(type);
if (schema != null && schema.getParent() != null) {
return getClassForType(schemaFactory, schema.getParent());
}
}
return clz;
}
開發者ID:rancher,項目名稱:cattle,代碼行數:12,
示例7: findRemovableTypes
點讚 2
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
protected synchronized Set findRemovableTypes() {
Set types = new HashSet<>();
for (Schema schema : schemaFactory.listSchemas()) {
while (schema.getParent() != null) {
schema = schemaFactory.getSchema(schema.getParent());
}
String type = schema.getId();
if (types.contains(type)) {
continue;
}
// restricting it to instance for now
if (!type.equalsIgnoreCase("instance")) {
continue;
}
Object stateField = objectMetaDataManager.convertFieldNameFor(type, ObjectMetaDataManager.STATE_FIELD);
if (stateField == null) {
continue;
}
String processName = objectProcessManager.getStandardProcessName(StandardProcess.REMOVE, type);
ProcessDefinition def = processManager.getProcessDefinition(processName);
if (def != null) {
types.add(type);
}
}
return types;
}
開發者ID:rancher,項目名稱:cattle,代碼行數:34,
示例8: findPurgableTypes
點讚 2
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
protected synchronized Set findPurgableTypes() {
Set types = new HashSet<>();
for (Schema schema : schemaFactory.listSchemas()) {
while (schema.getParent() != null) {
schema = schemaFactory.getSchema(schema.getParent());
}
String type = schema.getId();
if (types.contains(type)) {
continue;
}
Object fieldObj = objectMetaDataManager.convertFieldNameFor(type, ObjectMetaDataManager.REMOVED_FIELD);
if (fieldObj == null) {
/* This means there is no DB table with a removed field */
continue;
}
String processName = objectProcessManager.getStandardProcessName(StandardProcess.PURGE, type);
ProcessDefinition def = processManager.getProcessDefinition(processName);
if (def != null) {
types.add(type);
}
}
return types;
}
開發者ID:rancher,項目名稱:cattle,代碼行數:30,
示例9: getSchemaClass
點讚 2
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
@Override
public Class> getSchemaClass(String type, boolean resolveParent) {
Class> clz = getSchemaClass(type);
if (clz == null && resolveParent) {
Schema schema = getSchema(type);
if (schema != null && schema.getParent() != null) {
return getSchemaClass(schema.getParent(), true);
}
}
return clz;
}
開發者ID:rancher,項目名稱:cattle,代碼行數:12,
示例10: getMostSpecific
點讚 2
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
private static Schema getMostSpecific(SchemaFactory schemaFactory, Schema left, Schema right) {
if (left == null) {
return right;
}
if (right == null) {
return left;
}
while (left != null && left.getParent() != null) {
if (right.getId().equals(left.getParent())) {
return left;
}
left = schemaFactory.getSchema(left.getParent());
}
return right;
}
開發者ID:rancher,項目名稱:cattle,代碼行數:16,
示例11: getClassForType
點讚 2
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
protected Class> getClassForType(SchemaFactory schemaFactory, String type) {
Class> clz = schemaFactory.getSchemaClass(type);
if ( clz == null ) {
Schema schema = schemaFactory.getSchema(type);
if ( schema != null && schema.getParent() != null ) {
return getClassForType(schemaFactory, schema.getParent());
}
}
return clz;
}
開發者ID:cloudnautique,項目名稱:cloud-cattle,代碼行數:12,
示例12: findPurgableTypes
點讚 2
import io.github.ibuildthecloud.gdapi.model.Schema; //導入方法依賴的package包/類
protected synchronized Set findPurgableTypes() {
Set types = new HashSet();
for ( Schema schema : schemaFactory.listSchemas() ) {
while ( schema.getParent() != null ) {
schema = schemaFactory.getSchema(schema.getParent());
}
String type = schema.getId();
if ( types.contains(type) ) {
continue;
}
Object fieldObj = objectMetaDataManager.convertFieldNameFor(type, ObjectMetaDataManager.REMOVED_FIELD);
if ( fieldObj == null ) {
/* This means there is no DB table with a removed field */
continue;
}
String processName = objectProcessManager.getStandardProcessName(StandardProcess.PURGE, type);
ProcessDefinition def = processManager.getProcessDefinition(processName);
if ( def != null ) {
types.add(type);
}
}
return types;
}
開發者ID:cloudnautique,項目名稱:cloud-cattle,代碼行數:30,
注:本文中的io.github.ibuildthecloud.gdapi.model.Schema.getParent方法示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。