Code generation from java source files [closed] - java

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm currently working on a Java/Flex project and I'm looking for a way to generate some parts of my Actionscript code from my Java files.
One of the goal is to generate the AS valueObjects from the JAVA transferObject as well as some AS code to access the serverside function asynchronous.
And other important point is that I want to be independent of some IDE. The code generation should run from Maven or Ant and take the Java source code as input.
I looked a little bit around and found stuff like SpringROO, Groovy-GRAM, AST in eclipse,.. The guys from graniteDS do their code generation more or less the way I want to do it.
Thanks for any help or suggestions

I use now xText:
I created my one meta-model (grammar) from which I generate an eclipse editor plug-in. This plug-in helps me to create the textual model.
From the concrete model, I generate with xpand and xtend the Java and Actionscript code
Thanks all for your help.

You can use MTASC for command-line AS compiling.. It's an open-source command-line actionscript compiler. It produces swf files which can be loaded by your AS code.
Update:
For Java to AS compilation use J2AS.

Because you want an independent generator, AtomWeaver could be an option. It's a standalone tool with no other dependencies. It does not have a command-line option (it's IDE-like).
It's great if you want to build your own code generator using templates, but if you want a already-made generator then you're out of luck...

look at flexmojos project https://docs.sonatype.org/display/FLEXMOJOS/Home
it's a maven plugin for flex, you can specify a "generate" target and maven generates your vo from java files. https://docs.sonatype.org/display/FLEXMOJOS/Generator+Mojo

GraniteDS GAS3 is a good one for generating ActionScript code for vaule object.
The code generation can be customized using the groovy template.
http://www.graniteds.org/confluence/display/DOC/3.+Gas3+Template+Language
It integrates nicely with Eclipse IDE and also has ant and maven plugins

We use our web service xsds that define the types to auto generate our java transfer objects as well as our actionscript value objects using Freemarker. Hope this helps.

Related

Is there any reason to use Gradle if I'm just writing programs for myself? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Are there any benefits to using Gradle if I'm already using a modern IDE if I'm not part of a team, just writing JavaFX and Android programs for myself?
My previous question got closed as non constructive, I believe it's a legitimate question. Thanks
It is not the fact the how many developers working, do you have any requirements from the following?
Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else
If you have any requirement of above highlighted and project is big enough that you can't live happy with either ant scripts etc., (or) IDE provided build scripts, then you need Gradle type of tools. If you are on just learning type of project having this tool may help in learning those automation steps. This tools is not a mandatory one for web projects.
Do you also consider not writing tests for your own code?
Personally, I use gradle for all new projects, it gets you going very quickly, particularly if you stick with the default src dir structures, so it's not an overhead, just create a simple build.gradle and both your source and tests are sorted. I also use eclipse, but make gradle generate the project settings, so I only have to worry about jar dependencies in one place.
I find it's much better to get into the habit of using the same tooling whether you're doing personal projects or in part of a team.

Looking for Open Source Java Projects that use JUnit and Ant [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am currently doing some research and I am looking for open source Java projects that use JUnit and Ant. Ideally I would like to have projects that vary in size/complexity/domain as well as the test suite coverage.
I seem to be having a hard time finding suitable open source projects that fit these criteria:
Project has a number of JUnit test cases
All the JUnit test cases can be ran from a single test class (i.e., a JUnit TestSuite)
The project uses Ant for building and testing
I am sure that the community would benefit from a list of usable open source projects fitting the aforementioned criteria. It is always possible to learn from projects that use these technologies. As a side bonus researchers could also quickly identify suitable open source projects for their research.
The following are suitable open source project according to the criteria:
JGAP
Joda-Time
JSR-166
mark4j
Well, I just bumped onto JSR-166, the Java Specification Request for the various Concurrency utilities. The source code has an Ant task at the top level and a pretty extensive JUnit-based testsuite. As an added benefit, the units under test are actually classes that are included in the JDK, which has a couple of advantages:
They are very well documented, which is not usually the case.
Since they are part of the JDK, they should already be familiar to most experienced Java programmers. Understanding supporting infrastructure such as a build system or a test suite is hard enough without having to understand the actual codebase as well.
That said, there are a couple of issues as well:
The current code is bleeding edge - literally! The current version already requires at least Java 7 and seems geared towards Java 8. You might want to retrieve an older version of the code that is closer to the Java versions used in production.
The JSR-166 source code is not very well organized. The obvious issue I encountered was the lack of a singular package root and an overabundance of classes that belong to the default package. You have been warned...
PS: This question is not very suitable for StackOverflow, since it does not have one answer. I provided this answer to point out an obvious repository of code, i.e. Java itself, that inexperienced programmers tend to ignore completely, since they consider it part of the system...
marc4j fits your requirements. You can download the project, unpack, then compile and run JUnit tests using the included ant script.

Is there an open source java message flow designer or similar tool? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am looking for an opensource product or some code examples of how I might design either a Java or HTML based GUI to design message flows.
One would add nodes/entities to the diagram and then messages that would flow between entities. The properties of the nodes and entities could then be modified.
The reason I want to extend something open source or code it from scrath is that I have numerous formats that i want to export the data in such as :
An image of the flow for use in documentation.
Human readable description of the message flow.
A test script to simulate the flow.
In an ideal world this would eventually be an Eclispe plug-in which is why I'd like it to be done using a sutable Java GUI framework however if a tool exists that could export message flows in a good structured langauge (XML) I guess my tool could just import this and convert to the other formats required.
Any ideas?
Eclipse GMF is a good choice, but it is quite hard once you start putting in advanced features.
Take a look at the jboss jpdl designer. I think it is built on top of an extensible core library for graph modeling. I know for a fact that jBPM is built like that, so this one also might be built along the same lines. If it is so, you should be able to reuse the core library.

class file to java file conversion [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
How to get java file i.e source code from class file i.e from compiled file?
Check out this Java Decompiler.
Also see this Wikipedia page to know more about decompilation.
It should be noted that the code you get on decompilation of bytecode isn't very readable.
You have to use a disassembler.
Java Decompiler is a good choice.
Also Java Decompiler has a plug-in for Eclipse.
You can use javap command to get the overall structure of the file.
On the side note: Best way to disable anyone from getting the source from your compiled code is to use obfuscation.
You can make use of javap for getting the source back from bytecode.
There are plenty of tools and plugin that help you to disassemble and you can find some discussed here.
Yes you cannot do anything like reverse conversion.
What you can do is modify the bytecode at runtime. That's allowed in Java...
Check for java.lang.instrumentation package. That will help you to achieve your goal to some extent...
I just published a stand-alone Java Decompiler GUI (based on Jad) which you can get from Util Java Decompiler (JAD based) v1.0
This is a Windows based .NET 4.0 application, which supports the drag n'drop of *.jar files.

Which Eclipse version should I download? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am on a Windows machine.
Want to practise Java for the web using: Tomcat, Java, JSP's, Spring Framework, and Hibernate.
http://www.eclipse.org/downloads/
(Silly question, but I am a newbie and don't want to get the wrong IDE version.)
You want to practise java for the web using: tomcat, java, jsp's, spring framework, etc.
then you should download the Enterprised version.
Personally I would prefer NetBeans. I use it frequently and I find it better(simpler rather) than Eclipse.
Who says you need Eclipse? NetBeans and IntelliJ are both good choices as well.
If you're a newbie to Java, I'd recommend staying away from Tomcat and JSP until you can write the core language comfortably. Likewise, stay away from Hibernate until you've mastered JDBC. Spring is very complex tool that should come last in your development.
My recommended order would be:
Base Java, including JDBC.
Tomcat, servlets, and JSPs using JSTL (allowing CRUD-based web apps)
Spring
UPDATE: It's great that you're already familiar with relational databases, ORM, objects, and DI. But I'd still recommend that you learn the language basics first. If you're really good at C#, it won't take you too long. There's an idiom to every language that you'll want to know to write well. Take the time to try and find it.
I'd recommend either the classic or IDE for java developers first, and then as you get familiar install the other plugins that you'd want/need. That way you'll learn the structure better. That being said, use Netbeans instead.
You should go for Eclipse Java EE but AFAIK it won't come with app servers bundled in. So you'll need to install those in addition to Eclipse and configure it.
However, you can go with Netbeans and it all comes pre bundled and pre configured and you can simply get started with writing code.
As a learner Eclipse would be a better.
You can follow this URL to download it:
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/SR1/eclipse-java-galileo-SR1-win32.zip.
Once you are comfortable with the basic functionality with Java, you can start with any
web Server or an application server.
Then you can implement the Framework.
Personally Eclipse is very friendly in use.
Don't go for any of these.
As you are working on windows platform I would suggest you to first try out JBuilder. Checkit out! It is better in all ways compared to Eclipse and Net Beans but to gather, because it gives a Visual way to build your GUIs!
I am a long time IntelliJ IDEA fan, but if I need to do AspectJ work, I turn to STS. I found it real easy to get started with Eclipse because it seems to contain the plugins I need already.

Categories

Resources