Skip to content

DanielMSchmidt/java-method-parser

Repository files navigation

java-method-parser Build Status Coverage Status BCH compliance

Get an objective-c header file and translate it to equivalent javascript calls

Install

$ npm install java-method-parser

Usage

const fs = require("fs");
const javaMethodParser = require("java-method-parser");
const content = fs.readFileSync("/path/to/java/Ponies.java");

const output = javaMethodParser(content);

fs.writeFileSync("/path/to/project/ponies.json", output);

Example

package com.foo.bar.baz;

public class BasicName {
    private BasicName() {}

    /**
     *   asserting a matcher
     */
    public static ViewInteraction assertMatcher(ViewInteraction i, Matcher<View> m) {}

    // This is for asserting invisibility
    public static ViewInteraction assertNotVisible(ViewInteraction i) {}
}
{
	"name": "BasicName",
	"pcakage": "com.foo.bar",
	"methods": [
		{
			"args": [
				{
					"type": "ViewInteraction",
					"name": "i"
				},
				{
					"type": "Matcher<View>",
					"name": "m"
				}
			],
			"comment": "asserting a matcher",
			"name": "assertMatcher",
			"returnType": "ViewInteraction"
		},
		{
			"args": [
				{
					"type": "ViewInteraction",
					"name": "i"
				}
			],
			"comment": "This is for asserting invisibility",
			"name": "assertNotVisible",
			"returnType": "ViewInteraction"
		}
	]
}

License

MIT © Daniel Schmidt