Comments (15)
Here's a patch for the name:
Original comment by [email protected]
on 13 May 2010 at 9:01
Attachments:
from protostuff-googlecode-exported.
Damn. There's a semi colon missing in two places in that patch. Should be in
the
obvious location :)
Original comment by [email protected]
on 13 May 2010 at 9:02
from protostuff-googlecode-exported.
Actually, scratch that. I blame jetlag, that won't work. Open to other ideas.
Right now I
have an attribute that I strip out before serialising.
Original comment by [email protected]
on 14 May 2010 at 2:00
from protostuff-googlecode-exported.
Yep ... the limitation of the overlay.
The type descriptor could be added as an option.
It could be a generated service endpoint that handle that.
Would be great if you can contribute to tailor it to your needs.
Cheers
Original comment by [email protected]
on 14 May 2010 at 3:43
from protostuff-googlecode-exported.
Here's a different, still pretty ghetto, approach. I suspect the only way to
make this work
properly will be to move away from the JavaScriptObject based approach. As a
bonus, I
added hasFoo() methods.
Anthony
Original comment by [email protected]
on 14 May 2010 at 7:13
Attachments:
from protostuff-googlecode-exported.
I can add this via compiler options.
Not sure about moving away from JavaScriptObject on gwt.
In case you already have an idea, feel free to create a custom compiler.
Should be
pretty quick with stringtemplate. It could also be added to the list of
compilers.
I've just added a compiler that complements the code generated by c++ protoc.
http://code.google.com/p/protostuff/wiki/JSONSerialization#java_v2protoc_schema
Original comment by [email protected]
on 14 May 2010 at 4:48
- Changed state: Accepted
from protostuff-googlecode-exported.
The message fullname does need to be there on a protocol with multiple
protobuffers.
I'm proposing the ff. gwt_overlay options:
${messageName}.include_name
${messageName}.include_fullname
${packageName}.include_name
${packageName}.include_fullname
// to save space vs "_protoMessageName"
getProtobufName() would return instance["_pbn"]
getProtobufFullName() would return instance["_pbfn"]
Btw, is the name needed for the wrapped messages? From a protocol standpoint,
the
request message's descriptor might just be enough since it already identifies
its
message fields.
Original comment by [email protected]
on 15 May 2010 at 3:21
from protostuff-googlecode-exported.
Is it worth mirroring the Google PB approach of
getDescriptorForType().getName() (or
whatever it's spelt)...
Original comment by [email protected]
on 16 May 2010 at 7:33
from protostuff-googlecode-exported.
Yea it makes sense. Looking into it atm.
Original comment by [email protected]
on 16 May 2010 at 8:27
from protostuff-googlecode-exported.
The fields you were needing are only name and fullName right? (possibly
extensions also)
The others are for proto file metadata and others purely for dynamic messages.
I suppose you won't be needing these?
Original comment by [email protected]
on 16 May 2010 at 4:29
from protostuff-googlecode-exported.
Here's my current set of changes. Things I've added:
simple shim versions of newBuilder() and Builder
getFooList() methods for repeated fields
made setFoo return this
this makes a whole pile of code that was written against com.google.protobuf
just
work :)
Original comment by [email protected]
on 16 May 2010 at 8:07
Attachments:
from protostuff-googlecode-exported.
Hmm, so the compiler actually permits gwt overlays does allow to be subclassed.
Nice.
I'm getting errors ... getFooCount() doesn't exist
public final java.util.List<Integer> getSomeIntList() {
JsArrayInteger array = getSomeIntArray();
java.util.List<Integer> list = new java.util.ArrayList<Integer>();
if (array == null) {
return null;
}
for (int i=0; i < getSomeIntCount(); i++) {
list.add(array.get(i));
}
return list;
}
Will change it to:
JsArrayInteger array = getSomeIntArray();
if (array == null) {
return null;
}
java.util.List<Integer> list = new java.util.ArrayList<Integer>(array.length());
for (int i=0; i < array.length(); i++) {
list.add(array.get(i));
}
This will be added via option ("emulation_mode"?) on a separate stg ...
basically
extending the template gwt_overlay.stg. (like how java_bean_separate_schema.stg
works)
Thanks
Original comment by [email protected]
on 17 May 2010 at 6:23
from protostuff-googlecode-exported.
Its now added via gwt_overlay_emulation_mode.stg (rev 786)
I've added
[http://code.google.com/p/protostuff/wiki/WritingCustomCodeGenerators] so
I won't have to restructure your patch :P
Its preferred to always use an option for adding features/extras.
(one-size-does-not-fit-all)
Let me know if you're interested in contributing (with write access).
Cheers
Original comment by [email protected]
on 18 May 2010 at 12:43
from protostuff-googlecode-exported.
Original comment by [email protected]
on 20 May 2010 at 9:34
- Changed state: Fixed
from protostuff-googlecode-exported.
You can now supply your customized stg resource to the compiler.
Just rename it to gwt_overlay.java.stg (.java indicates the type of resource it
generates)
gwt.output = path/to/your/custom/gwt_overlay.java.stg
It should work out-of-the-box since your modified stg already contains the
templates
necessary.
Hope that helps.
Original comment by [email protected]
on 31 May 2010 at 2:42
from protostuff-googlecode-exported.
Related Issues (20)
- Would like support for repeated accessors with out "List" appeneded
- Enter one-line summary HOT 2
- getSchema() of java.util.Properties fails HOT 2
- optimize xml format
- Enum alias support
- YamlOutput bug on repeated message fields HOT 1
- Deserializing a message which is protostuff-runtime serialized and has custom class as field HOT 3
- Visual disturbance of @Deprecated annotation HOT 12
- Support for newing object instances on Android 4.3+ devices HOT 2
- ConcurrentLinkedDeque support HOT 1
- Produces uncompilable Java when a field is called "default" HOT 4
- 1.0.7 Build error: ProtoParserTest fails HOT 2
- protostuff-parser and protostuff-compiler disagree on required version of antlr
- Optimize ProtobufOuput for small nested messages (max size of 127) HOT 1
- How can I serialize a negative int32 to the protobuf format using zigzag encoding? HOT 2
- How to Ignore Array of Null Values in JSON
- enums_by_name does not seem to be working using maven plugin
- The value of DataInput.readByte() should not be eof-checked since that method throws EOFException HOT 1
- Wrong output path is generated in Windows for .java files HOT 3
- Unable to parse proto enum containing hex constants HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protostuff-googlecode-exported.