airbnb / DeepLinkDispatch

A simple, annotation-based library for making deep link handling better on Android
http://nerds.airbnb.com/deeplinkdispatch/
4.38k stars 407 forks source link

Move parameter parsing to compile time #18

Open felipecsl opened 9 years ago

felipecsl commented 9 years ago

We could move the regex code that extracts parameters from the URI into compile time by baking that into the processor

realdadfish commented 8 years ago

That would also help for a request of mine - the generation of a Parameters class that lists all used parameters for a specific URL configuration. Like, when you have

@DeepLink("foo://bar/{baz}/{bla}")
public class SomeActivity extends Activity { ... }

it would create this

public interface DeepLinkParams {
    public interface SomeActivity {
        String BAZ = "baz";
        String BLA = "bla";
    }
}

This would enable us to access URL parameters by constants at compile time, without having them "silently" drift apart over time, but instead error out in the face if something changed.

felipecsl commented 8 years ago

yeah, that's pretty much what I had in mind