enunciate

articulate your web api.

Objective C Module

The Objective C module generates Objective C classes and (de)serialization functions that can be used in conjunction with libxml2 to (de)serialize the REST resources as they are represented as XML data.

The order of the Objective C deployment module is 0, as it doesn't depend on any artifacts exported by any other module.

Configuration

The Objective C module is configured with the "obj-c" element under the "modules" element of the enunciate configuration file. It supports the following attributes:

  • The "label" attribute is the label for the Objective C API. This is the name by which the file will be identified (producing [label].m and [label].h). By default the label is the same as the Enunciate project label.
  • The "forceEnable" attribute is used to force-enable the Objective C module. By default, the Objective C module is enabled only if REST endpoints are found in the project.
  • The "enumConstantNamePattern" attribute defines the format string for converting an enum constant name to a unique c-style constant name. The arguments passed to the format string are: (1) the project label (2) the namespace id of the type definition (3) the name of the type definition (4) the NOT decapitalized annotation-specified client name of the type declaration (5) the decapitalized annotation-specified client name of the type declaration (6) the NOT-decapitalized simple name of the type declaration (7) the decapitalized simple name of the type declaration (8) the package identifier (9) the annotation-specified client name of the enum contant (10) the simple name of the enum constant. All tokens will be "scrubbed" by replacing any non-word character with the "_" character. The default value for this pattern is "%1$S_%2$S_%3$S_%9$S".
  • The "typeDefinitionNamePattern" attribute defines the format string for converting an type definition name to a unique c-style name. The arguments passed to the format string are: (1) the project label (2) the namespace id of the type definition (3) the name of the type definition (4) the NOT decapitalized annotation-specified client name of the type declaration (5) the decapitalized annotation-specified client name of the type declaration (6) the NOT-decapitalized simple name of the type declaration (7) the decapitalized simple name of the type declaration (8) the package identifier. All tokens will be "scrubbed" by replacing any non-word character with the "_" character. The default value for this pattern is "%1$S%2$S%4$s".
  • The "packageIdentifierPattern" attribute defines the format string for creating a unique package identifier for a given package. The arguments passed to the format string will be each subpackage. So, for package "org.codehaus.enunciate.samples.c", The arguments are (1) org (2) codehaus (3) enunciate (4) samples (5) c. The default package identifier is the package name. The package identifier is in turn passed as an argument to the "enumConstantNamePattern" and to the "typeDefinitionNamePattern".
  • The 'translateIdTo' attribute specifies what to use as the name of an accessor when in Java it's named 'id' (which is a keyword in Objective C).
  • The 'separateCommonCode' attribute tells Enunciate to keep the code that is common to all Enunciate-generated projects separate from the code that is generated specifically for this project. Default: true.

In addition to the attributes specified above, the Objective C module configuration supports an arbitrary number of "package" child elements, used to explicitly assign package identifiers to each package. The "package" child element supports a "name" attribute (used to name the package) and an "identifier" attribute.

The "facets" element

The "facets" element is applicable to the Objective C module to configure which facets are to be included/excluded from the Objective C artifacts. For more information, see API Facets

Flattr this