Java 类org.apache.thrift.scheme.SchemeFactory 实例源码

项目:thrift-java-compiler    文件:StructCodeGeneratorHelper.java   
private JDefinedClass createServicesMethodSendClassArgsStandardSchemeFactory(JDefinedClass _class, List<JVar> list) throws JClassAlreadyExistsException {
    JDefinedClass standardSchemeClass = createServicesMethodSendClassArgsStandardScheme(_class, list);
    JDefinedClass factoryClass = _class._class(JMod.PUBLIC|JMod.STATIC, _class.name() + STANDARD_SCHEME + "Factory")._implements(SchemeFactory.class);

    JMethod method = factoryClass.method(JMod.PUBLIC, standardSchemeClass, "getScheme");
    method.body()._return(JExpr._new(standardSchemeClass));

    return factoryClass;
}
项目:pinot    文件:ThriftSampleData.java   
public void read(TProtocol iprot) throws TException {
    ((SchemeFactory)schemes.get(iprot.getScheme())).getScheme().read(iprot, this);
}
项目:pinot    文件:ThriftSampleData.java   
public void write(TProtocol oprot) throws TException {
    ((SchemeFactory)schemes.get(oprot.getScheme())).getScheme().write(oprot, this);
}
项目:thrift-java-compiler    文件:StructCodeGeneratorHelper.java   
private JDefinedClass createServicesMethodSendClassArgsTupleSchemeFactory(JDefinedClass _class, List<JVar> list) throws JClassAlreadyExistsException {
    JDefinedClass tupleSchemeClass = createServicesMethodSendClassArgsTupleScheme(_class, list);

    JDefinedClass factoryClass = _class._class(JMod.PUBLIC | JMod.STATIC, _class.name() + TUPLE_SCHEME + "Factory")._implements(SchemeFactory.class);

    JMethod method = factoryClass.method(JMod.PUBLIC, tupleSchemeClass, "getScheme");
    method.body()._return(JExpr._new(tupleSchemeClass));

    return factoryClass;
}