當前位置: 首頁>>代碼示例>>Java>>正文


Java TypeResolver類代碼示例

本文整理匯總了Java中com.redhat.lightblue.metadata.TypeResolver的典型用法代碼示例。如果您正苦於以下問題:Java TypeResolver類的具體用法?Java TypeResolver怎麽用?Java TypeResolver使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TypeResolver類屬於com.redhat.lightblue.metadata包,在下文中一共展示了TypeResolver類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getMd

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
public EntityMetadata getMd(String fname)  {
    //runValidJsonTest("json-schema/metadata/metadata.json", fname);
    try {
        JsonNode node = loadJsonNode(fname);
        Extensions<JsonNode> extensions = new Extensions<>();
        extensions.addDefaultExtensions();
        extensions.registerDataStoreParser("mongo", new MongoDataStoreParser<JsonNode>());
        TypeResolver resolver = new DefaultTypes();
        JSONMetadataParser parser = new JSONMetadataParser(extensions, resolver, nodeFactory);
        EntityMetadata md = parser.parseEntityMetadata(node);
        PredefinedFields.ensurePredefinedFields(md);
        return md;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-mongo,代碼行數:17,代碼來源:AbstractMongoCrudTest.java

示例2: getMd

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
public EntityMetadata getMd(String fname) throws Exception {
    JsonNode node = loadJsonNode(fname);
    Extensions<JsonNode> extensions = new Extensions<>();
    extensions.addDefaultExtensions();
    extensions.registerDataStoreParser("mongo", new FakeMongoDataStoreParser<JsonNode>());
    TypeResolver resolver = new DefaultTypes();
    JSONMetadataParser parser = new JSONMetadataParser(extensions, resolver, JsonNodeFactory.instance);
    EntityMetadata md = parser.parseEntityMetadata(node);
    PredefinedFields.ensurePredefinedFields(md);
    return md;
}
 
開發者ID:esbtools,項目名稱:lightblue-notification-hook,代碼行數:12,代碼來源:NotificationHookTest.java

示例3: getMd

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
public EntityMetadata getMd(String fname) throws Exception {
    JsonNode node = loadJsonNode(fname);
    Extensions<JsonNode> extensions = new Extensions<>();
    extensions.addDefaultExtensions();
    extensions.registerDataStoreParser("mongo", new MongoDataStoreParser<JsonNode>());
    TypeResolver resolver = new DefaultTypes();
    JSONMetadataParser parser = new JSONMetadataParser(extensions, resolver, nodeFactory);
    EntityMetadata emd = parser.parseEntityMetadata(node);
    PredefinedFields.ensurePredefinedFields(emd);
    return emd;
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-mongo,代碼行數:12,代碼來源:BsonMergeTest.java

示例4: getMd

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
private EntityMetadata getMd(String fname) {
    try {
        JsonNode node = loadJsonNode(fname);
        Extensions<JsonNode> extensions = new Extensions<>();
        extensions.addDefaultExtensions();
        extensions.registerDataStoreParser("mongo", new TestDataStoreParser<JsonNode>());
        TypeResolver resolver = new DefaultTypes();
        JSONMetadataParser parser = new JSONMetadataParser(extensions, resolver, JsonNodeFactory.instance);
        EntityMetadata md = parser.parseEntityMetadata(node);
        PredefinedFields.ensurePredefinedFields(md);
        return md;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-core,代碼行數:16,代碼來源:ExecutionPlanTest.java

示例5: getMd

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
private EntityMetadata getMd(String fname) throws Exception {
    JsonNode node = loadJsonNode(fname);
    Extensions<JsonNode> extensions = new Extensions<>();
    extensions.addDefaultExtensions();
    extensions.registerDataStoreParser("mongo", new TestDataStoreParser<JsonNode>());
    TypeResolver resolver = new DefaultTypes();
    JSONMetadataParser parser = new JSONMetadataParser(extensions, resolver, factory);
    return parser.parseEntityMetadata(node);
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-core,代碼行數:10,代碼來源:QueryPlanChooserTest.java

示例6: getMd

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
private EntityMetadata getMd(String fname) {
    try {
        JsonNode node = loadJsonNode(fname);
        Extensions<JsonNode> extensions = new Extensions<>();
        extensions.addDefaultExtensions();
        extensions.registerDataStoreParser("mongo", new TestDataStoreParser<JsonNode>());
        TypeResolver resolver = new DefaultTypes();
        JSONMetadataParser parser = new JSONMetadataParser(extensions, resolver, nodeFactory);
        EntityMetadata md = parser.parseEntityMetadata(node);
        PredefinedFields.ensurePredefinedFields(md);
        return md;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-core,代碼行數:16,代碼來源:CompositeFinderTest.java

示例7: getMd

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
private EntityMetadata getMd(String fname) throws Exception {
    JsonNode node = loadJsonNode(fname);
    Extensions<JsonNode> extensions = new Extensions<>();
    extensions.addDefaultExtensions();
    extensions.registerDataStoreParser("mongo", new TestDataStoreParser<JsonNode>());
    TypeResolver resolver = new DefaultTypes();
    JSONMetadataParser parser = new JSONMetadataParser(extensions, resolver, JsonNodeFactory.instance);
    return parser.parseEntityMetadata(node);
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-core,代碼行數:10,代碼來源:SortTest.java

示例8: getMd

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
public static EntityMetadata getMd(String fname) throws Exception {
    JsonNode node = loadJsonNode(fname);
    Extensions<JsonNode> extensions = new Extensions<>();
    extensions.addDefaultExtensions();
    extensions.registerDataStoreParser("mongo", new TestDataStoreParser<JsonNode>());
    TypeResolver resolver = new DefaultTypes();
    JSONMetadataParser parser = new JSONMetadataParser(extensions, resolver, factory);
    EntityMetadata md = parser.parseEntityMetadata(node);
    PredefinedFields.ensurePredefinedFields(md);
    return md;
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-core,代碼行數:12,代碼來源:EvalTestContext.java

示例9: getMD

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
private EntityMetadata getMD(String fname) throws Exception {
    JsonNode node = loadJsonNode(fname);
    Extensions<JsonNode> extensions = new Extensions<>();
    extensions.addDefaultExtensions();
    extensions.registerDataStoreParser("mongo", new TestDataStoreParser<JsonNode>());
    TypeResolver typeResolver = new DefaultTypes();
    JSONMetadataParser parser = new JSONMetadataParser(extensions, typeResolver, nodeFactory);
    EntityMetadata md = parser.parseEntityMetadata(node);
    PredefinedFields.ensurePredefinedFields(md);
    return md;
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-core,代碼行數:12,代碼來源:HookManagerTest.java

示例10: BSONParser

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
public BSONParser(Extensions<Object> ex,
                  TypeResolver resolver) {
    super(ex, resolver);
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-mongo,代碼行數:5,代碼來源:BSONParser.java

示例11: fillDefaults

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
/**
 * Given the parameter values supplied by the caller, returns a
 * map containing default values for missing parameters. If there
 * are missing required parameters, throws an Error with missing
 * parameters.
 */
public static Map<String,String> fillDefaults(JsonNode savedSearch,
                                              Map<String,String> parameterValues,
                                              TypeResolver types) {
    Map<String,String> ret=new HashMap<>();
    JsonNode parametersNode=savedSearch.get("parameters");
    if(parametersNode instanceof ArrayNode) {
        for(Iterator<JsonNode> itr=parametersNode.elements();itr.hasNext();) {
            JsonNode parameterNode=itr.next();
            if(parameterNode instanceof ObjectNode) {
                Type type=null;
                JsonNode x=parameterNode.get("name");
                String name=x.asText();
                x=parameterNode.get("type");
                if(x!=null) {
                    type=types.getType(x.asText());
                    if(type==null) {
                        throw Error.get(ERR_SAVED_SEARCH_INVALID_TYPE,x.asText());
                    }
                } else {
                    type=StringType.TYPE;
                }
                boolean optional=false;
                x=parameterNode.get("optional");                    
                if(x!=null) {
                    optional=x.asBoolean();
                }
                if(parameterValues.containsKey(name)) {
                    ret.put(name,(String)StringType.TYPE.cast(type.cast(parameterValues.get(name))));
                } else if(optional) {
                    // Fill it in using default value                    
                    JsonNode defaultValue=parameterNode.get("defaultValue");
                    if(defaultValue==null)
                        throw Error.get(ERR_SAVED_SEARCH_NO_DEFAULT_VALUE,name);
                    ret.put(name,(String)StringType.TYPE.cast(type.fromJson(defaultValue)));
                } else {
                    throw Error.get(ERR_SAVED_SEARCH_MISSING_PARAM,name);
                }                    
            }
        }
    }
    return ret;
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-core,代碼行數:49,代碼來源:FindRequestBuilder.java

示例12: MetadataParser

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
public MetadataParser(Extensions<T> ex, TypeResolver typeResolver) {
    this.extensions = ex;
    this.typeResolver = typeResolver;
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-core,代碼行數:5,代碼來源:MetadataParser.java

示例13: JSONMetadataParser

import com.redhat.lightblue.metadata.TypeResolver; //導入依賴的package包/類
public JSONMetadataParser(Extensions<JsonNode> ex,
                          TypeResolver resolver,
                          JsonNodeFactory factory) {
    super(ex, resolver);
    this.factory = factory;
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-core,代碼行數:7,代碼來源:JSONMetadataParser.java


注:本文中的com.redhat.lightblue.metadata.TypeResolver類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。