Browse files

Merge branch 'master' into v1.26

  • Loading branch information...
2 parents f7ed4a2 + 1f88730 commit 50774e0da62ace8f4db20bf0a88eb81c2647d42e @stoicflame committed Aug 8, 2012
Showing with 316 additions and 41 deletions.
  1. +2 −2 amf/src/main/java/org/codehaus/enunciate/modules/amf/AS3ClientClassnameForMethod.java
  2. +3 −1 c/src/main/java/org/codehaus/enunciate/modules/c/ClientClassnameForMethod.java
  3. +35 −0 c/src/main/resources/org/codehaus/enunciate/modules/c/common.fmt
  4. +2 −0 core/src/main/java/org/codehaus/enunciate/apt/EnunciateFreemarkerModel.java
  5. +1 −1 core/src/main/java/org/codehaus/enunciate/contract/jaxb/Accessor.java
  6. +2 −0 core/src/main/java/org/codehaus/enunciate/contract/jaxb/types/XmlPrimitiveType.java
  7. +6 −1 core/src/main/java/org/codehaus/enunciate/contract/jaxb/types/XmlTypeFactory.java
  8. +7 −0 core/src/main/java/org/codehaus/enunciate/contract/jaxb/types/XmlTypeVisitor.java
  9. +28 −18 core/src/main/java/org/codehaus/enunciate/contract/jaxb/util/JAXBUtil.java
  10. +97 −0 .../src/main/java/org/codehaus/enunciate/contract/jaxb/util/NarrowingCollectionComponentVisitor.java
  11. +3 −1 csharp/src/main/java/org/codehaus/enunciate/modules/csharp/ClientClassnameForMethod.java
  12. +13 −11 docs/src/main/resources/org/codehaus/enunciate/modules/docs/docs.fmt
  13. +13 −0 ...ests/jaxws-ri-rest/src/main/samples/full/org/codehaus/enunciate/samples/genealogy/data/Event.java
  14. +14 −0 ...s-ri-rest/src/main/samples/full/org/codehaus/enunciate/samples/genealogy/data/EventAttribute.java
  15. +26 −0 ...-rest/src/main/samples/full/org/codehaus/enunciate/samples/genealogy/data/EventAttributeImpl.java
  16. +9 −0 ...tests/jaxws-ri-rest/src/main/samples/full/org/codehaus/enunciate/samples/genealogy/data/Name.java
  17. +3 −1 obj-c/src/main/java/org/codehaus/enunciate/modules/objc/ClientClassnameForMethod.java
  18. +1 −1 obj-c/src/main/java/org/codehaus/enunciate/modules/objc/FunctionIdentifierForMethod.java
  19. +46 −0 obj-c/src/main/resources/org/codehaus/enunciate/modules/objc/common.fmt
  20. +2 −1 ruby/src/main/java/org/codehaus/enunciate/modules/ruby/ClientClassnameForMethod.java
  21. +3 −3 xml/src/main/java/org/codehaus/enunciate/modules/xml/XMLDeploymentModule.java
View
4 amf/src/main/java/org/codehaus/enunciate/modules/amf/AS3ClientClassnameForMethod.java
@@ -51,7 +51,7 @@ public AS3ClientClassnameForMethod(Map<String, String> conversions) {
classConversions.put(Double.class.getName(), "Number");
classConversions.put(Long.class.getName(), "Number");
classConversions.put(Float.class.getName(), "Number");
- classConversions.put(Character.class.getName(), "String");
+ classConversions.put(Character.class.getName(), "Number");
classConversions.put(Date.class.getName(), "Date");
classConversions.put(DataHandler.class.getName(), "flash.utils.ByteArray");
classConversions.put(QName.class.getName(), "String");
@@ -73,7 +73,7 @@ public String convert(TypeMirror typeMirror) throws TemplateModelException {
case BYTE:
return "int";
case CHAR:
- return "String";
+ return "Number";
case DOUBLE:
return "Number";
case FLOAT:
View
4 c/src/main/java/org/codehaus/enunciate/modules/c/ClientClassnameForMethod.java
@@ -53,7 +53,7 @@ public ClientClassnameForMethod(Map<String, String> conversions) {
classConversions.put(java.math.BigInteger.class.getName(), "xmlChar");
classConversions.put(java.math.BigDecimal.class.getName(), "xmlChar");
classConversions.put(Float.class.getName(), "float");
- classConversions.put(Character.class.getName(), "xmlChar");
+ classConversions.put(Character.class.getName(), "unsigned short");
classConversions.put(Date.class.getName(), "struct tm");
classConversions.put(DataHandler.class.getName(), "unsigned char");
classConversions.put(java.awt.Image.class.getName(), "unsigned char");
@@ -141,6 +141,8 @@ public String convert(TypeMirror typeMirror) throws TemplateModelException {
return "double";
case LONG:
return "long";
+ case CHAR:
+ return "unsigned short";
default:
return "xmlChar";
}
View
35 c/src/main/resources/org/codehaus/enunciate/modules/c/common.fmt
@@ -523,6 +523,41 @@ static void free${prefix("http://www.w3.org/2001/XMLSchema")?cap_first}ShortType
//no-op
}
+/*******************xs:unsignedShort************************************/
+
+/**
+ * Read an unsigned short value from the reader.
+ *
+ * @param reader The reader (pointing at a node with a value).
+ * @return pointer to the unsigned short.
+ */
+static unsigned short *xmlTextReaderRead${prefix("http://www.w3.org/2001/XMLSchema")?cap_first}UnsignedShortType(xmlTextReaderPtr reader) {
+ xmlChar *nodeValue = xmlTextReaderReadEntireNodeValue(reader);
+ unsigned short *value = malloc(sizeof(unsigned short));
+ *value = atoi((char *)nodeValue);
+ return value;
+}
+
+/**
+ * Write a short value to the writer.
+ *
+ * @param writer The writer.
+ * @param value The value to be written.
+ * @return the bytes written (may be 0 because of buffering) or -1 in case of error.
+ */
+static int xmlTextWriterWrite${prefix("http://www.w3.org/2001/XMLSchema")?cap_first}UnsignedShortType(xmlTextWriterPtr writer, unsigned short *value) {
+ return xmlTextWriterWriteFormatString(writer, "%hi", *value);
+}
+
+/**
+ * Frees a short type from memory.
+ *
+ * @param value The value to free.
+ */
+static void free${prefix("http://www.w3.org/2001/XMLSchema")?cap_first}UnsignedShortType(unsigned short *value) {
+ //no-op
+}
+
/*******************xs:string************************************/
/**
View
2 core/src/main/java/org/codehaus/enunciate/apt/EnunciateFreemarkerModel.java
@@ -195,6 +195,7 @@ public EnunciateFreemarkerModel() {
knownTypes.put(Boolean.class.getName(), KnownXmlType.BOOLEAN);
knownTypes.put(Byte.class.getName(), KnownXmlType.BYTE);
+ knownTypes.put(Character.class.getName(), KnownXmlType.UNSIGNED_SHORT);
knownTypes.put(Double.class.getName(), KnownXmlType.DOUBLE);
knownTypes.put(Float.class.getName(), KnownXmlType.FLOAT);
knownTypes.put(Integer.class.getName(), KnownXmlType.INT);
@@ -207,6 +208,7 @@ public EnunciateFreemarkerModel() {
knownTypes.put(Integer.TYPE.getName(), KnownXmlType.INT);
knownTypes.put(Long.TYPE.getName(), KnownXmlType.LONG);
knownTypes.put(Short.TYPE.getName(), KnownXmlType.SHORT);
+ knownTypes.put(Character.TYPE.getName(), KnownXmlType.UNSIGNED_SHORT);
knownTypes.put(String.class.getName(), KnownXmlType.STRING);
knownTypes.put(java.math.BigInteger.class.getName(), KnownXmlType.INTEGER);
knownTypes.put(java.math.BigDecimal.class.getName(), KnownXmlType.DECIMAL);
View
2 core/src/main/java/org/codehaus/enunciate/contract/jaxb/Accessor.java
@@ -109,7 +109,7 @@ public TypeMirror getAccessorType() {
accessorType = ((PropertyDeclaration) delegate).getPropertyType();
}
- TypeMirror bareCollection = JAXBUtil.findCollectionOrList(accessorType);
+ TypeMirror bareCollection = JAXBUtil.getNormalizedCollection(accessorType);
if (bareCollection != null) {
accessorType = bareCollection;
}
View
2 core/src/main/java/org/codehaus/enunciate/contract/jaxb/types/XmlPrimitiveType.java
@@ -46,6 +46,8 @@ public String getName() {
return "long";
case SHORT:
return "short";
+ case CHAR:
+ return "unsignedShort";
}
return null;
View
7 core/src/main/java/org/codehaus/enunciate/contract/jaxb/types/XmlTypeFactory.java
@@ -25,6 +25,9 @@
import com.sun.mirror.type.TypeMirror;
import com.sun.mirror.type.MirroredTypeException;
import net.sf.jelly.apt.Context;
+import net.sf.jelly.apt.decorations.TypeMirrorDecorator;
+import net.sf.jelly.apt.decorations.declaration.DecoratedTypeDeclaration;
+import net.sf.jelly.apt.decorations.type.DecoratedTypeMirror;
import org.codehaus.enunciate.contract.jaxb.Accessor;
import org.codehaus.enunciate.contract.jaxb.adapters.Adaptable;
import static org.codehaus.enunciate.contract.jaxb.util.JAXBUtil.unwrapComponentType;
@@ -147,7 +150,9 @@ public static XmlType findExplicitSchemaType(Accessor accessor) {
*/
public static XmlType getXmlType(TypeMirror typeMirror) throws XmlTypeException {
XmlTypeVisitor visitor = new XmlTypeVisitor();
- visitor.isInArray = (typeMirror instanceof ArrayType);
+ DecoratedTypeMirror decorated = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(typeMirror);
+ visitor.isInCollection = decorated.isCollection();
+ visitor.isInArray = decorated.isArray();
unwrapComponentType(typeMirror).accept(visitor);
if (visitor.getErrorMessage() != null) {
View
7 core/src/main/java/org/codehaus/enunciate/contract/jaxb/types/XmlTypeVisitor.java
@@ -40,6 +40,10 @@
* State-keeping variable used to determine whether we've already been visited by an array type.
*/
boolean isInArray;
+ /**
+ * State-keeping variable used to determine whether we've already been visited by a collection type.
+ */
+ boolean isInCollection;
private XmlType xmlType;
private String errorMessage = null;
@@ -146,6 +150,9 @@ public void visitInterfaceType(InterfaceType interfaceType) {
if (mapType != null) {
setMapXmlType(mapType);
}
+ else if (isInCollection) {
+ this.xmlType = KnownXmlType.ANY_TYPE;
+ }
else {
this.xmlType = null;
this.errorMessage = "An interface type cannot be an xml type.";
View
46 core/src/main/java/org/codehaus/enunciate/contract/jaxb/util/JAXBUtil.java
@@ -21,7 +21,6 @@
import com.sun.mirror.declaration.TypeParameterDeclaration;
import com.sun.mirror.type.*;
import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration;
import net.sf.jelly.apt.decorations.declaration.DecoratedTypeDeclaration;
import net.sf.jelly.apt.decorations.type.DecoratedTypeMirror;
import net.sf.jelly.apt.decorations.TypeMirrorDecorator;
@@ -70,23 +69,34 @@ else if (decoratedType.isCollection()) {
return typeMirror;
}
- /**
- * Strip the extensions of java.util.Collection or java.util.List until you get the raw type mirror.
- *
- * @param typeMirror The type mirror to strip.
- * @return The strip or the original type mirror.
- */
- public static TypeMirror stripCollectionExtensions(TypeMirror typeMirror) {
- TypeMirror tm = JAXBUtil.findCollectionOrList(typeMirror);
- if (tm != null) {
- return TypeMirrorDecorator.decorate(tm);
- }
- else {
- return typeMirror;
+ public static TypeMirror getNormalizedCollection(TypeMirror typeMirror) {
+ TypeMirror base = findCollectionStrippedOfExtensions(typeMirror);
+ if (base != null) {
+ //now narrow the component type to what can be valid xml.
+ Collection<TypeMirror> typeArgs = ((DeclaredType) base).getActualTypeArguments();
+ if (typeArgs.size() == 1) {
+ TypeMirror candidateToNarrow = typeArgs.iterator().next();
+ NarrowingCollectionComponentVisitor visitor = new NarrowingCollectionComponentVisitor();
+ candidateToNarrow.accept(visitor);
+ TypeMirror narrowing = visitor.getResult();
+ if (narrowing != null) {
+ TypeDeclaration decl = ((DeclaredType) base).getDeclaration();
+ while (decl instanceof DecoratedTypeDeclaration) {
+ decl = (TypeDeclaration) ((DecoratedTypeDeclaration) decl).getDelegate();
+ }
+
+ while (narrowing instanceof DecoratedTypeMirror) {
+ narrowing = ((DecoratedTypeMirror) narrowing).getDelegate();
+ }
+
+ base = Context.getCurrentEnvironment().getTypeUtils().getDeclaredType(decl, narrowing);
+ }
+ }
}
+ return TypeMirrorDecorator.decorate(base);
}
- public static TypeMirror findCollectionOrList(TypeMirror typeMirror) {
+ private static TypeMirror findCollectionStrippedOfExtensions(TypeMirror typeMirror) {
TypeMirror found = null;
if (typeMirror instanceof DeclaredType) {
@@ -98,14 +108,14 @@ public static TypeMirror findCollectionOrList(TypeMirror typeMirror) {
}
else {
for (InterfaceType si : decl.getSuperinterfaces()) {
- found = findCollectionOrList(si);
+ found = findCollectionStrippedOfExtensions(si);
if (found != null) {
break;
}
}
if (found == null && decl instanceof ClassDeclaration) {
- found = findCollectionOrList(((ClassDeclaration) decl).getSuperclass());
+ found = findCollectionStrippedOfExtensions(((ClassDeclaration) decl).getSuperclass());
}
if (found != null) {
@@ -148,7 +158,7 @@ public static TypeMirror findCollectionOrList(TypeMirror typeMirror) {
}
}
- return TypeMirrorDecorator.decorate(found);
+ return found;
}
}
View
97 ...n/java/org/codehaus/enunciate/contract/jaxb/util/NarrowingCollectionComponentVisitor.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2006-2008 Web Cohesion
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.codehaus.enunciate.contract.jaxb.util;
+
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.declaration.ClassDeclaration;
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.TypeVisitor;
+import net.sf.jelly.apt.Context;
+import net.sf.jelly.apt.freemarker.FreemarkerModel;
+import org.codehaus.enunciate.apt.EnunciateFreemarkerModel;
+import org.codehaus.enunciate.contract.jaxb.TypeDefinition;
+import org.codehaus.enunciate.contract.jaxb.adapters.AdapterType;
+import org.codehaus.enunciate.contract.jaxb.adapters.AdapterUtil;
+import org.codehaus.enunciate.contract.jaxb.types.*;
+import org.codehaus.enunciate.util.MapType;
+import org.codehaus.enunciate.util.MapTypeUtil;
+
+import javax.xml.bind.annotation.XmlTransient;
+import java.util.Iterator;
+
+/**
+ * Utility visitor for discovering the xml types of type mirrors.
+ *
+ * @author Ryan Heaton
+ */
+class NarrowingCollectionComponentVisitor implements TypeVisitor {
+
+ private TypeMirror result;
+
+ NarrowingCollectionComponentVisitor() {
+ }
+
+ public TypeMirror getResult() {
+ return result;
+ }
+
+ public void visitTypeMirror(TypeMirror typeMirror) {
+ }
+
+ public void visitPrimitiveType(PrimitiveType primitiveType) {
+ }
+
+ public void visitVoidType(VoidType voidType) {
+ }
+
+ public void visitReferenceType(ReferenceType referenceType) {
+ }
+
+ public void visitDeclaredType(DeclaredType declaredType) {
+ }
+
+ public void visitClassType(ClassType classType) {
+ }
+
+ public void visitEnumType(EnumType enumType) {
+ }
+
+ public void visitInterfaceType(InterfaceType interfaceType) {
+ AdapterType adapterType = AdapterUtil.findAdapterType(interfaceType.getDeclaration());
+ if (adapterType == null) {
+ //the interface isn't adapted, check for @XmlTransient and if it's there, narrow it to java.lang.Object.
+ //see https://jira.codehaus.org/browse/ENUNCIATE-660
+ if (interfaceType.getDeclaration() != null && interfaceType.getDeclaration().getAnnotation(XmlTransient.class) != null) {
+ AnnotationProcessorEnvironment env = Context.getCurrentEnvironment();
+ this.result = env.getTypeUtils().getDeclaredType(env.getTypeDeclaration(Object.class.getName()));
+ }
+ }
+ }
+
+ public void visitAnnotationType(AnnotationType annotationType) {
+ }
+
+ public void visitArrayType(ArrayType arrayType) {
+ }
+
+ public void visitTypeVariable(TypeVariable typeVariable) {
+ }
+
+ public void visitWildcardType(WildcardType wildcardType) {
+ }
+
+}
View
4 csharp/src/main/java/org/codehaus/enunciate/modules/csharp/ClientClassnameForMethod.java
@@ -55,7 +55,7 @@ public ClientClassnameForMethod(Map<String, String> conversions) {
classConversions.put(java.math.BigInteger.class.getName(), "long?");
classConversions.put(java.math.BigDecimal.class.getName(), "decimal?");
classConversions.put(Float.class.getName(), "float?");
- classConversions.put(Character.class.getName(), "char?");
+ classConversions.put(Character.class.getName(), "ushort?");
classConversions.put(Date.class.getName(), "DateTime?");
classConversions.put(DataHandler.class.getName(), "byte[]");
classConversions.put(java.awt.Image.class.getName(), "byte[]");
@@ -127,6 +127,8 @@ public String convert(TypeMirror typeMirror) throws TemplateModelException {
switch (kind) {
case BOOLEAN:
return "bool"; //boolean as 'bool'
+ case CHAR:
+ return "ushort";
default:
return kind.toString().toLowerCase();
}
View
24 docs/src/main/resources/org/codehaus/enunciate/modules/docs/docs.fmt
@@ -1179,43 +1179,45 @@
<p>${value}</p>
[/#list]
+ [#if includeExampleJson!true]
<h2>JSON</h2>
<table>
<tr>
<th>property</th>
<th>type</th>
<th>description</th>
</tr>
- [#list type.attributes.attribute as attribute]
+ [#list type.attributes.attribute as attribute]
<tr>
<td>[#if attributeExists(attribute.@jsonName)]${attribute.@jsonName}[/#if]</td>
<td>[#if attributeExists(attribute.@typeSchemaId)][#if attributeExists(attribute.@typeName)][#assign typename=attribute.@typeName/][#else][#assign typename="(anonymous)"/][/#if]<a href="${attribute.@typeSchemaId}_${typename}.html">${typename}</a>[#elseif attributeExists(attribute.@typeName)]${attribute.@typeName}[/#if]</td>
<td>${attribute}</td>
</tr>
- [/#list]
- [#list type.elements.element as element]
+ [/#list]
+ [#list type.elements.element as element]
<tr>
<td>[#if attributeExists(element.@jsonName)]${element.@jsonName}[/#if]</td>
<td>
- [#list element.choice as choice]
- [#if element.@maxOccurs = "unbounded"]array of [/#if][#if choice_index > 0]<br/>or [/#if][#if attributeExists(choice.@schemaId)]<a href="el_${choice.@schemaId}_${choice.@name}.html">${choice.@name}</a>[#else]${choice.@name}[/#if][#if attributeExists(choice.@typeSchemaId)][#if attributeExists(choice.@typeName)][#assign typename=choice.@typeName/][#else][#assign typename="(anonymous)"/][/#if] (<a href="${choice.@typeSchemaId}_${typename}.html">${typename}</a>)[#elseif attributeExists(choice.@typeName)] (${choice.@typeName})[/#if]
- [/#list]
+ [#list element.choice as choice]
+ [#if element.@maxOccurs = "unbounded"]array of [/#if][#if choice_index > 0]<br/>or [/#if][#if attributeExists(choice.@schemaId)]<a href="el_${choice.@schemaId}_${choice.@name}.html">${choice.@name}</a>[#else]${choice.@name}[/#if][#if attributeExists(choice.@typeSchemaId)][#if attributeExists(choice.@typeName)][#assign typename=choice.@typeName/][#else][#assign typename="(anonymous)"/][/#if] (<a href="${choice.@typeSchemaId}_${typename}.html">${typename}</a>)[#elseif attributeExists(choice.@typeName)] (${choice.@typeName})[/#if]
+ [/#list]
</td>
<td>
- [#list element.documentation as documentation]
+ [#list element.documentation as documentation]
${documentation}
- [/#list]
+ [/#list]
</td>
</tr>
- [/#list]
- [#list type.value as value]
+ [/#list]
+ [#list type.value as value]
<tr>
<td>[#if attributeExists(value.@jsonName)]${value.@jsonName}[/#if]</td>
<td>[#if attributeExists(value.@typeSchemaId)][#if attributeExists(value.@typeName)][#assign typename=value.@typeName/][#else][#assign typename="(anonymous)"/][/#if]<a href="${value.@typeSchemaId}_${typename}.html">${typename}</a>[#elseif attributeExists(value.@typeName)]${value.@typeName}[/#if]</td>
<td>${value}</td>
</tr>
- [/#list]
+ [/#list]
</table>
+ [/#if]
[/#if]
[/@boilerplate]
[/@file]
View
13 ...ws-ri-rest/src/main/samples/full/org/codehaus/enunciate/samples/genealogy/data/Event.java
@@ -17,6 +17,8 @@
package org.codehaus.enunciate.samples.genealogy.data;
import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.Arrays;
@@ -34,6 +36,7 @@
private String description;
private final List<String> tags = new ArrayList<String>();
private String explanation;
+ private List<EventAttribute> attributes;
/**
* The type of this event.
@@ -88,4 +91,14 @@ public String getExplanation() {
public void setExplanation(String explanation) {
this.explanation = explanation;
}
+
+ @XmlElementWrapper ( name = "attributes" )
+ @XmlElement ( name = "attribute" )
+ public List<EventAttribute> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(List<EventAttribute> attributes) {
+ this.attributes = attributes;
+ }
}
View
14 ...t/src/main/samples/full/org/codehaus/enunciate/samples/genealogy/data/EventAttribute.java
@@ -0,0 +1,14 @@
+package org.codehaus.enunciate.samples.genealogy.data;
+
+import javax.xml.bind.annotation.XmlTransient;
+
+/**
+ * @author Ryan Heaton
+ */
+@XmlTransient
+public interface EventAttribute {
+
+ String getName();
+
+ String getValue();
+}
View
26 ...c/main/samples/full/org/codehaus/enunciate/samples/genealogy/data/EventAttributeImpl.java
@@ -0,0 +1,26 @@
+package org.codehaus.enunciate.samples.genealogy.data;
+
+/**
+ * @author Ryan Heaton
+ */
+public class EventAttributeImpl implements EventAttribute {
+
+ private String name;
+ private String value;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
View
9 ...xws-ri-rest/src/main/samples/full/org/codehaus/enunciate/samples/genealogy/data/Name.java
@@ -24,6 +24,7 @@
public class Name extends Assertion {
private String value;
+ private Character middleInitial;
/**
* The text value of the name.
@@ -42,4 +43,12 @@ public String getValue() {
public void setValue(String value) {
this.value = value;
}
+
+ public Character getMiddleInitial() {
+ return middleInitial;
+ }
+
+ public void setMiddleInitial(Character middleInitial) {
+ this.middleInitial = middleInitial;
+ }
}
View
4 obj-c/src/main/java/org/codehaus/enunciate/modules/objc/ClientClassnameForMethod.java
@@ -53,7 +53,7 @@ public ClientClassnameForMethod(Map<String, String> conversions) {
classConversions.put(java.math.BigInteger.class.getName(), "NSNumber");
classConversions.put(java.math.BigDecimal.class.getName(), "NSDecimalNumber");
classConversions.put(Float.class.getName(), "float");
- classConversions.put(Character.class.getName(), "xmlChar");
+ classConversions.put(Character.class.getName(), "unsigned short");
classConversions.put(Date.class.getName(), "NSDate");
classConversions.put(DataHandler.class.getName(), "NSData");
classConversions.put(java.awt.Image.class.getName(), "NSData");
@@ -141,6 +141,8 @@ public String convert(TypeMirror typeMirror) throws TemplateModelException {
return "double";
case LONG:
return "long";
+ case CHAR:
+ return "unsigned short";
default:
return "NSString";
}
View
2 obj-c/src/main/java/org/codehaus/enunciate/modules/objc/FunctionIdentifierForMethod.java
@@ -109,7 +109,7 @@ else if (Byte.class.getName().equals(classname)) {
return "Byte";
}
else if (Character.class.getName().equals(classname)) {
- return "Character";
+ return "UnsignedShort";
}
else if (Double.class.getName().equals(classname)) {
return "Double";
View
46 obj-c/src/main/resources/org/codehaus/enunciate/modules/objc/common.fmt
@@ -494,6 +494,25 @@ short *xmlTextReaderReadShortType(xmlTextReaderPtr reader);
*/
int xmlTextWriterWriteShortType(xmlTextWriterPtr writer, short *value);
+/*******************unsigned short***************************/
+
+/**
+ * Read an unsigned short value from the reader.
+ *
+ * @param reader The reader (pointing at a node with a value).
+ * @return the unsigned short.
+ */
+unsigned short *xmlTextReaderReadUnsignedShortType(xmlTextReaderPtr reader);
+
+/**
+ * Write an unsigned short value to the writer.
+ *
+ * @param writer The writer.
+ * @param value The value to be written.
+ * @return the bytes written (may be 0 because of buffering) or -1 in case of error.
+ */
+int xmlTextWriterWriteUnsignedShortType(xmlTextWriterPtr writer, unsigned short *value);
+
/*******************char************************************/
/**
@@ -2139,6 +2158,33 @@ int xmlTextWriterWriteShortType(xmlTextWriterPtr writer, short *value) {
return xmlTextWriterWriteFormatString(writer, "%hi", *value);
}
+/*******************unsigned short***************************/
+
+/**
+ * Read an unsigned short value from the reader.
+ *
+ * @param reader The reader (pointing at a node with a value).
+ * @return the unsigned short.
+ */
+unsigned short *xmlTextReaderReadUnsignedShortType(xmlTextReaderPtr reader) {
+ xmlChar *nodeValue = xmlTextReaderReadEntireNodeValue(reader);
+ unsigned short *value = malloc(sizeof(unsigned short));
+ *value = atoi((char *)nodeValue);
+ free(nodeValue);
+ return value;
+}
+
+/**
+ * Write an unsigned short value to the writer.
+ *
+ * @param writer The writer.
+ * @param value The value to be written.
+ * @return the bytes written (may be 0 because of buffering) or -1 in case of error.
+ */
+int xmlTextWriterWriteUnsignedShortType(xmlTextWriterPtr writer, unsigned short *value) {
+ return xmlTextWriterWriteFormatString(writer, "%hi", *value);
+}
+
/*******************char************************************/
/**
View
3 ruby/src/main/java/org/codehaus/enunciate/modules/ruby/ClientClassnameForMethod.java
@@ -58,7 +58,7 @@ public ClientClassnameForMethod(Map<String, String> conversions) {
classConversions.put(java.math.BigInteger.class.getName(), "Bignum");
classConversions.put(java.math.BigDecimal.class.getName(), "Float");
classConversions.put(Float.class.getName(), "Float");
- classConversions.put(Character.class.getName(), "String");
+ classConversions.put(Character.class.getName(), "Fixnum");
classConversions.put(Date.class.getName(), "Time");
classConversions.put(DataHandler.class.getName(), "String");
classConversions.put(java.awt.Image.class.getName(), "String");
@@ -164,6 +164,7 @@ public String convert(TypeMirror typeMirror) throws TemplateModelException {
case BYTE:
case INT:
case SHORT:
+ case CHAR:
return "Fixnum";
case FLOAT:
case DOUBLE:
View
6 xml/src/main/java/org/codehaus/enunciate/modules/xml/XMLDeploymentModule.java
@@ -49,7 +49,7 @@
/**
* <h1>XML Module</h1>
*
- * <p>The XML deployment module generates the consolidated WSDLs and schemas for the API.</a>.
+ * <p>The XML deployment module generates the consolidated WSDLs, WADL and schemas for the API.</a>.
*
* <ul>
* <li><a href="#steps">steps</a></li>
@@ -62,7 +62,7 @@
* <h3>generate</h3>
*
* <p>The only significant step in the XML deployment module is the "generate" step. This step generates the
- * WSDLs and schemas for the API.</p>
+ * WSDLs, WADL and schemas for the API.</p>
*
* <h1><a name="config">Configuration</a></h1>
*
@@ -103,7 +103,7 @@
* <h1><a name="artifacts">Artifacts</a></h1>
*
* <p>The XML deployment module exports artifacts for each WSDL and schema produced. The id of the artifact is the name of the prefix for the namespace of hte
- * file appended with ".wsdl" (for wsdls) and ".xsd" (for schemas).</p>
+ * file appended with ".wsdl" (for wsdls), ".wadl" (for the wadl), and ".xsd" (for schemas).</p>
*
* @author Ryan Heaton
* @docFileName module_xml.html

0 comments on commit 50774e0

Please sign in to comment.