Closed allComputableThings closed 6 years ago
Or is there some feature that does this already?
I'm part way through builder an StructMetaDatabuilder for unannotated Java and scala types. I have some questions about StructMetaDatabuilder. Given:
@ThriftStruct
final public class JavaBean {
public JavaBean() {}
private String street = "";
@ThriftField(1)
public String getStreet() { return street; }
@ThriftField
public void setStreet(String street) { this.street=street; }
}
then StructMetaDatabuilder yields:
ThriftStructMetadata{
structName='JavaBean',
structType=class net.ailive.JavaBean,
builderType=null,
builderMethod=Optional.absent(),
fields={
1=ThriftFieldMetadata{
id=1,
thriftType=ThriftType{STRING class java.lang.String},
name='street', fieldKind=THRIFT_FIELD,
injections=[ThriftParameterInjection{fieldId=1, name=street, index=0, javaType=class java.lang.String}],
constructorInjection=Optional.absent(),
methodInjection=Optional.absent(),
extraction=Optional.of(ThriftMethodExtractor{id=1, name='street', fieldKind=THRIFT_FIELD, method=public java.lang.String net.ailive.JavaBean.getStreet(), type=class java.lang.String}),
coercion=Optional.absent()}},
constructorInjection=Optional.of(net.ailive.JavaBean()),
methodInjections=[setStreet(ThriftParameterInjection{fieldId=1, name=street, index=0, javaType=class java.lang.String})]}
(not trying to criticize, just trying to understand what's what).
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
I'd like make it easy to taken existing service interfaces (dealing with some third party beans types), and make them available as a swift service and generate thrift clients via swift2thrift.
A number of serialization frameworks provide the ability to serialize types without adding requiring ownership of the source code for that types (e.g. Jackson support serialization of beans) -- so, I'm working on a method to register types prior to:
I'm looking at providing an alternate SwiftStructMetaDataBuilder to do this. It will:
Does this look the reasonable approach (adding a SwiftStructMetaDataBuilder, using it to generate a ThriftType and registering the type with the catalog)?