Naming of emitted Java methods

2 questions which both boil down to whether one can change the names emitted by the compiler.

I have a protocol with a method called get:

public protocol Http
{
     func get( url: String, success: HttpResponse -> Void, failure: HttpResponse -> Void );
 }

The equivalent java function is named get__success__failure() , which is pretty clunky! Can I change it back to just get() ?

Secondly, I have a swift class like this:

public class SomeClass
{
   public var json: Json!
}

The emitted java equivalent has

public class SomeClass 
{   
  public Json getjson() 
  public void setjson(Json value) 
 }

The problem here is the lack of camel casing on the property, which means that its not a valid Java bean. Is there any way around this without having to use upper case names for all my Swift properties?

Thanks

Jon

Yes, use:

public protocol Http
{
     func get( url: String, _ success: HttpResponse ->; Void, _ failure: HttpResponse ->; Void );
 }

Ie make it use no selector arguments.

This is a tricky one. Originally we DID uppercase the first letter, but this caused a lot of issues so we don’t anymore.

So really the solution is to just use uppercase in the original code, i.e. public var Json: Json! or public var JSON: Json!.

Thanks, I wasn’t across the _ syntax, and I will go with the uppercase properties, as microsofty as it makes me feel…

Nb

 public var Json: Json!

Actually gives a compile error in XCode:

  P.swift:48:13: error: 'Json' used within its own type

Just checking that there is still no way to emit proper Java getters?

The pain it’s causing me right now is trying to use Silver classes with a library like Jackson (Json serialiser) which expects getMyProperty() not getmyProperty().
Jackson finds no properties on a silver class.

I cannot use upper case properties in this case, as on the iOS / XCode side I want to use the Swift 4 JsonEncoder, which will use the property name as is - so it has to be delcared as myProperty.