Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-368

Return list of properties based on higher-level understanding

    XMLWordPrintable

Details

    Description

      Hi guys,

      As I understand it, Forge has an understanding of your project that transcends Java's own understanding. So for example if I say...

      field string --named foo

      ...Forge knows I'm creating a property, and it creates getters and setters for that property. But later if I do...

      org.jboss.forge.parser.java.JavaClass.getMethods()

      ...then I get back just normal methods. I'll have to check their signature for 'get' or 'set' to see if they're properties. Equally if I do...

      org.jboss.forge.parser.java.JavaClass.getFields()

      ...I get back just normal fields. I don't know if these are property fields (and if so, what their corresponding getter/setter methods are) or whether they're just internal fields (and should be ignored).

      Is there a recommended way to 'get back out' the list of properties for a class? Something that tells me a) the field; b) the getter; c) the setter?

      If it helps, for now I am using a rough implementation at: https://github.com/kennardconsulting/forge/blob/master/scaffold-metawidget/src/main/java/org/jboss/forge/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kennardconsulting Richard Kennard (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: