• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MetadataParser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.redhat.lightblue.metadata.parser.MetadataParser的典型用法代码示例。如果您正苦于以下问题:Java MetadataParser类的具体用法?Java MetadataParser怎么用?Java MetadataParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MetadataParser类属于com.redhat.lightblue.metadata.parser包,在下文中一共展示了MetadataParser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: parse

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public DataStore parse(String name, MetadataParser<T> p, T node) {
    if (!NAME.equals(name)) {
        throw Error.get(MetadataConstants.ERR_ILL_FORMED_METADATA, name);
    }

    MongoDataStore ds = new MongoDataStore();
    ds.setDatabaseName(p.getStringProperty(node, "database"));
    ds.setDatasourceName(p.getStringProperty(node, "datasource"));
    ds.setCollectionName(p.getStringProperty(node, "collection"));
    if (ds.getCollectionName() == null
            || ds.getCollectionName().length() == 0) {
        throw Error.get(COLLECTION_REQUIRED, "datastore");
    }
    return ds;
}
 
开发者ID:lightblue-platform,项目名称:lightblue-mongo,代码行数:17,代码来源:MongoDataStoreParser.java


示例2: parseProperty

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public LdapMetadata parseProperty(MetadataParser<T> p, T container, String name) {
    if (!LdapConstant.BACKEND.equals(name)) {
        throw Error.get(MetadataConstants.ERR_ILL_FORMED_METADATA, name);
    }

    LdapMetadata ldapMetadata = new LdapMetadata();

    T ldapMetadataNode = p.getMapProperty(container, name);
    
    T fieldToAttributesNode = p.getMapProperty(ldapMetadataNode, FIELDS_TO_ATTRIBUTES);
    if(fieldToAttributesNode != null){
        int n = p.getListSize(fieldToAttributesNode);
        for (int i = 0; i < n; i++) {
            T fieldToAttributeNode = p.getListElement(fieldToAttributesNode, i);
            ldapMetadata.addFieldToAttribute(
                    new Path(p.getRequiredStringProperty(fieldToAttributeNode, FIELD)),
                    p.getRequiredStringProperty(fieldToAttributeNode, ATTRIBUTE));
        }
    }

    return ldapMetadata;
}
 
开发者ID:lightblue-platform,项目名称:lightblue-ldap,代码行数:24,代码来源:LdapPropertyParser.java


示例3: parse

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
public <T> void parse(MetadataParser<T> p, T t) {
    List<T> tst = p.getObjectList(t, "tables");
    List<Table> ts = parseTables(p, tst);

    String jts = p.getStringProperty(t, "joinTablesStatement");
    Object needDistinct1 = p.getValueProperty(t, "needDistinct");
    if(needDistinct1 != null) {
        this.needDistinct = (Boolean) needDistinct1;
    }
    List<T> pmsT = p.getObjectList(t, "projectionMappings");
    List<ProjectionMapping> pms = parseProjectionMappings(p, pmsT);

    this.tables = ts;
    this.joinTablesStatement = jts;
    this.projectionMappings = pms;
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:17,代码来源:Join.java


示例4: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object expressionsNode) {
    T eT = p.newNode();
    Object ts = p.newArrayField(eT, "tables");
    convertTables(p, ts);

    p.putString(eT, "joinTablesStatement", joinTablesStatement);

    if(needDistinct) {
        p.putValue(eT, "needDistinct", needDistinct);
    }

    Object ps = p.newArrayField(eT, "projectionMappings");
    convertProjectionMappings(p, ps);

    p.addObjectToArray(expressionsNode, eT);
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:18,代码来源:Join.java


示例5: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object expressionsNode) {
    if (iterateOverField == null || iterateOverField.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No foreach's iterateOverField informed");
    }
    if (expressions == null || expressions.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No foreach's expressions informed");
    }
    T eT = p.newNode();
    p.putString(eT, "iterateOverField", iterateOverField.toString());
    Object o = p.newArrayField(eT, "expressions");
    for (Expression expression : expressions) {
        expression.convert(p, o);
    }
    T s = p.newNode();
    p.putObject(s, "foreach", eT);

    p.addObjectToArray(expressionsNode, s);
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:20,代码来源:ForEach.java


示例6: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object lastArrayNode, T node) {
    if (field == null || field.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No field informed");
    }
    if (op == null || op.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No op informed");
    }
    if (rfield == null || rfield.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No rfield informed");
    }
    T s = p.newNode();

    p.putString(s, "field", field.toString());
    p.putString(s, "rfield", rfield.toString());
    p.putString(s, "op", op);

    if (lastArrayNode == null) {
        p.putObject(node, "fieldCheckField", s);
    } else {
        T iT = p.newNode();
        p.putObject(iT, "fieldCheckField", s);
        p.addObjectToArray(lastArrayNode, iT);
    }
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:26,代码来源:IfFieldCheckField.java


示例7: parse

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> If parse(MetadataParser<T> p, T ifT) {
    If x = null;
    T pathpath = p.getObjectProperty(ifT, "fieldCheckField");
    if (pathpath != null) {
        x = new IfFieldCheckField();
        String conditional = p.getStringProperty(pathpath, "op");
        String path1 = p.getStringProperty(pathpath, "field");
        String path2 = p.getStringProperty(pathpath, "rfield");
        if (path1 == null || path1.isEmpty()) {
            throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "fieldCheckField: field not informed");
        }
        if (path2 == null || path2.isEmpty()) {
            throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "fieldCheckField: rfield not informed");
        }
        if (conditional == null || conditional.isEmpty()) {
            throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "fieldCheckField: op not informed");
        }
        ((IfFieldCheckField) x).setField(new Path(path1));
        ((IfFieldCheckField) x).setRfield(new Path(path2));
        ((IfFieldCheckField) x).setOp(conditional);
    }
    return x;
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:25,代码来源:IfFieldCheckField.java


示例8: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object lastArrayNode, T node) {
    if (getConditions() == null || getConditions().size() != 1) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "not doesn't have just one conditional");
    }
    If o = getConditions().get(0);
    T eT = p.newNode();
    o.convert(p, lastArrayNode, eT);
    if (lastArrayNode == null) {
        p.putObject(node, "not", eT);
    } else {
        T iT = p.newNode();
        p.putObject(iT, "not", eT);
        p.addObjectToArray(lastArrayNode, iT);
    }
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:17,代码来源:IfNot.java


示例9: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object lastArrayNode, T node) {
    if (getConditions() == null || getConditions().size() < 2) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "or/any doesn't have enough conditionals");
    }
    Object eT;
    if (lastArrayNode == null) {
        eT = p.newArrayField(node, "or");
    } else {
        T iT = p.newNode();
        eT = p.newArrayField(iT, "or");
        p.addObjectToArray(iT, eT);
        p.addObjectToArray(lastArrayNode, iT);
    }
    for (If i : getConditions()) {
        i.convert(p, eT, node);
    }
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:19,代码来源:IfOr.java


示例10: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object lastArrayNode, T node) {
    if (anIf == null) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No if informed");
    }
    if (then == null) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No then informed");
    }
    T eT = p.newNode();

    T iT = p.newNode();
    p.putObject(eT, "if", iT);

    anIf.convert(p, null, iT);
    then.convert(p, null, eT); //it already add then

    p.addObjectToArray(lastArrayNode, eT);
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:19,代码来源:ElseIf.java


示例11: parse

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> If parse(MetadataParser<T> p, T ifT) {
    If x = null;
    T pathvalues = p.getObjectProperty(ifT, "fieldCheckValues");
    if (pathvalues != null) {
        x = new IfFieldCheckValues();
        String conditional = p.getStringProperty(pathvalues, "op");
        String path1 = p.getStringProperty(pathvalues, "field");
        List<String> values2 = p.getStringList(pathvalues, "values");
        if (path1 == null || path1.isEmpty()) {
            throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "fieldCheckValues: field not informed");
        }
        if (values2 == null || values2.isEmpty()) {
            throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "fieldCheckValues: values not informed");
        }
        if (conditional == null || conditional.isEmpty()) {
            throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "fieldCheckValues: op not informed");
        }
        ((IfFieldCheckValues) x).setField(new Path(path1));
        ((IfFieldCheckValues) x).setValues(values2);
        ((IfFieldCheckValues) x).setOp(conditional);
    }
    return x;
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:25,代码来源:IfFieldCheckValues.java


示例12: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object lastArrayNode, T node) {
    if (field == null || field.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No field informed");
    }
    T s = p.newNode();

    p.putString(s, "field", field.toString());

    if (lastArrayNode == null) {
        p.putObject(node, "fieldEmpty", s);
    } else {
        T iT = p.newNode();
        p.putObject(iT, "fieldEmpty", s);
        p.addObjectToArray(lastArrayNode, iT);
    }
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:18,代码来源:IfFieldEmpty.java


示例13: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object expressionsNode) {
    if (SQL == null) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No SQL statement informed");
    }
    if (type == null) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No type informed");
    }

    T eT = p.newNode();

    p.putString(eT, "sql", SQL);
    p.putString(eT, "type", type);

    T s = p.newNode();
    p.putObject(s, "statement", eT);

    p.addObjectToArray(expressionsNode, s);
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:20,代码来源:Statement.java


示例14: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object expressionsNode) {
    if (loopTimes == 0 || loopTimes < 0) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No loopTimes informed");
    }
    if (loopCounterVariableName == null || loopCounterVariableName.length() == 0) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No loopCounterVariableName informed");
    }
    if (expressions == null || expressions.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No for's expressions informed");
    }
    T eT = p.newNode();
    p.putString(eT, "loopTimes", Integer.toString(loopTimes));
    p.putString(eT, "loopCounterVariableName", loopCounterVariableName);
    Object o = p.newArrayField(eT, "expressions");
    for (Expression expression : expressions) {
        expression.convert(p, o);
    }
    T s = p.newNode();
    p.putObject(s, "for", eT);

    p.addObjectToArray(expressionsNode, s);
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:24,代码来源:For.java


示例15: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object lastArrayNode, T node) {
    if (getConditions() == null || getConditions().size() < 2) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "and/all doesn't have enough conditionals");
    }
    Object eT;
    if (lastArrayNode == null) {
        eT = p.newArrayField(node, "and");
    } else {
        T iT = p.newNode();
        eT = p.newArrayField(iT, "and");
        p.addObjectToArray(lastArrayNode, iT);
    }
    for (If i : getConditions()) {
        i.convert(p, eT, node);
    }
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:18,代码来源:IfAnd.java


示例16: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object lastArrayNode, T node) {
    if (field == null || field.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No field informed");
    }
    if (op == null || op.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No op informed");
    }
    if (value == null || value.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No value informed");
    }
    T s = p.newNode();

    p.putString(s, "field", field.toString());
    p.putString(s, "value", value);
    p.putString(s, "op", op);

    if (lastArrayNode == null) {
        p.putObject(node, "fieldCheckValue", s);
    } else {
        T iT = p.newNode();
        p.putObject(iT, "fieldCheckValue", s);
        p.addObjectToArray(lastArrayNode, iT);
    }
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:26,代码来源:IfFieldCheckValue.java


示例17: parse

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> If parse(MetadataParser<T> p, T ifT) {
    If x = null;
    T pathvalue = p.getObjectProperty(ifT, "fieldCheckValue");
    if (pathvalue != null) {
        x = new IfFieldCheckValue();
        String fieldString = p.getStringProperty(pathvalue, "field");
        String valueString = p.getStringProperty(pathvalue, "value");
        String opString = p.getStringProperty(pathvalue, "op");
        if (fieldString == null || fieldString.isEmpty()) {
            throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "fieldCheckValue: field not informed");
        }
        if (valueString == null || valueString.isEmpty()) {
            throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "fieldCheckValue: value not informed");
        }
        if (opString == null || opString.isEmpty()) {
            throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "fieldCheckValue: op not informed");
        }
        ((IfFieldCheckValue) x).setField(new Path(fieldString));
        ((IfFieldCheckValue) x).setValue(valueString);
        ((IfFieldCheckValue) x).setOp(opString);
    }
    return x;
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:25,代码来源:IfFieldCheckValue.java


示例18: convert

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
@Override
public <T> void convert(MetadataParser<T> p, Object expressionsNode) {
    T eT = p.newNode();
    if (column == null || column.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "Missing column field");
    }
    if (field == null || field.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "Missing 'field' field");
    }
    p.putString(eT, "column", column);
    p.putString(eT, "field", field);

    if (sort != null && !sort.isEmpty()) {
        p.putString(eT, "sort", sort);
    }

    p.addObjectToArray(expressionsNode, eT);
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:19,代码来源:ProjectionMapping.java


示例19: parse

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
public <T> void parse(MetadataParser<T> p, T t) {
    String c = p.getStringProperty(t, "column");
    String f = p.getStringProperty(t, "field");
    String s = p.getStringProperty(t, "sort");

    if (c == null || c.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "Missing column field");
    }

    if (f == null || f.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "Missing 'field' field");
    }

    column = c;
    field = f;
    sort = s;
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:18,代码来源:ProjectionMapping.java


示例20: parseOperation

import com.redhat.lightblue.metadata.parser.MetadataParser; //导入依赖的package包/类
private Operation parseOperation(MetadataParser<T> p, T operation, String fieldName) {
    if (operation == null) {
        return null;
    }
    T b = p.getObjectProperty(operation, "bindings");
    Bindings bindings = null;
    if (b != null) {
        bindings = parseBindings(p, b);
    }
    List<T> expressionsT = p.getObjectList(operation, "expressions");
    if (expressionsT == null || expressionsT.isEmpty()) {
        throw com.redhat.lightblue.util.Error.get(RDBMSConstants.ERR_FIELD_REQUIRED, "No expressions informed for Operation " + fieldName);
    }
    List<Expression> expressions = parseExpressions(p, expressionsT);

    final Operation s = new Operation();
    s.setBindings(bindings);
    s.setExpressionList(expressions);
    s.setName(fieldName);

    return s;
}
 
开发者ID:lightblue-platform,项目名称:lightblue-rdbms,代码行数:23,代码来源:RDBMSPropertyParserImpl.java



注:本文中的com.redhat.lightblue.metadata.parser.MetadataParser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DefaultInputPort类代码示例发布时间:2022-05-23
下一篇:
Java AbstractTubeImpl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap