https://github.com/danielmschmidt/java-method-parser
A node utility to get the methods out of java files
https://github.com/danielmschmidt/java-method-parser
java parser
Last synced: 12 months ago
JSON representation
A node utility to get the methods out of java files
- Host: GitHub
- URL: https://github.com/danielmschmidt/java-method-parser
- Owner: DanielMSchmidt
- License: mit
- Created: 2017-10-04T16:54:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T03:14:28.000Z (almost 2 years ago)
- Last Synced: 2024-11-12T21:51:28.906Z (over 1 year ago)
- Topics: java, parser
- Language: Java
- Size: 2.5 MB
- Stars: 1
- Watchers: 2
- Forks: 4
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: license
Awesome Lists containing this project
README
# java-method-parser [](https://travis-ci.org/DanielMSchmidt/java-method-parser) [](https://coveralls.io/github/DanielMSchmidt/java-method-parser?branch=master) [](https://bettercodehub.com/)
> Get an objective-c header file and translate it to equivalent javascript calls
## Install
```
$ npm install java-method-parser
```
## Usage
```js
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
```java
package com.foo.bar.baz;
public class BasicName {
private BasicName() {}
/**
* asserting a matcher
*/
public static ViewInteraction assertMatcher(ViewInteraction i, Matcher m) {}
// This is for asserting invisibility
public static ViewInteraction assertNotVisible(ViewInteraction i) {}
}
```
```json
{
"name": "BasicName",
"pcakage": "com.foo.bar",
"methods": [
{
"args": [
{
"type": "ViewInteraction",
"name": "i"
},
{
"type": "Matcher",
"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](http://danielmschmidt.de)