Class Generator


  • public class Generator
    extends java.lang.Object
    Code generator for accessing OData services. The generator use metadata exposed by an online service to generate client-side artifacts facilitating the execution of queries on the available entities.
    Author:
    Thierry Boileau
    • Constructor Summary

      Constructors 
      Constructor Description
      Generator​(java.lang.String serviceUri)
      Constructor.
      Generator​(java.lang.String serviceUri, java.lang.String serviceClassName)
      Constructor.
      Generator​(org.restlet.data.Reference serviceRef)
      Constructor.
      Generator​(org.restlet.data.Reference serviceRef, java.lang.String serviceClassName)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void generate​(java.io.File outputDir)
      Generates the client code to the given output directory.
      void generate​(java.lang.String outputDir)
      Generates the client code to the given output directory.
      static void main​(java.lang.String[] args)
      Takes two (or three) parameters:
      The URI of the OData service The output directory (optional, used the current directory by default) The name of the generated service class name (optional)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Generator

        public Generator​(org.restlet.data.Reference serviceRef)
        Constructor.
        Parameters:
        serviceRef - The URI of the OData service.
      • Generator

        public Generator​(org.restlet.data.Reference serviceRef,
                         java.lang.String serviceClassName)
        Constructor. The name of the service class can be provided if there is only one service defined in the metadata.
        Parameters:
        serviceRef - The URI of the OData service.
        serviceClassName - The name of the service class (in case there is only one in the metadata).
      • Generator

        public Generator​(java.lang.String serviceUri)
        Constructor.
        Parameters:
        serviceUri - The URI of the OData service.
      • Generator

        public Generator​(java.lang.String serviceUri,
                         java.lang.String serviceClassName)
        Constructor. The name of the service class can be provided if there is only one service defined in the metadata.
        Parameters:
        serviceUri - The URI of the OData service.
        serviceClassName - The name of the service class (in case there is only one in the metadata).
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Takes two (or three) parameters:
        1. The URI of the OData service
        2. The output directory (optional, used the current directory by default)
        3. The name of the generated service class name (optional)
        Parameters:
        args - The list of arguments.
      • generate

        public void generate​(java.io.File outputDir)
                      throws java.lang.Exception
        Generates the client code to the given output directory.
        Parameters:
        outputDir - The output directory.
        Throws:
        java.lang.Exception
      • generate

        public void generate​(java.lang.String outputDir)
                      throws java.lang.Exception
        Generates the client code to the given output directory.
        Parameters:
        outputDir - The output directory.
        Throws:
        java.lang.Exception