예제 #1
0
 public void visitClassType(ClassType classType) {
   MapType mapType = MapTypeUtil.findMapType(classType);
   if (mapType != null) {
     setMapXmlType(mapType);
   } else {
     XmlType xmlType = null;
     EnunciateFreemarkerModel model = (EnunciateFreemarkerModel) FreemarkerModel.get();
     ClassDeclaration declaration = classType.getDeclaration();
     if (declaration != null) {
       XmlType knownType = model.getKnownType(declaration);
       if (knownType != null) {
         xmlType = knownType;
       } else {
         // type not known, not specified.  Last chance: look for the type definition.
         TypeDefinition typeDefinition = model.findTypeDefinition(declaration);
         if (typeDefinition != null) {
           xmlType = new XmlClassType(typeDefinition);
         }
       }
     }
     this.xmlType = xmlType;
     if (xmlType == null) {
       this.errorMessage =
           "Unknown xml type for class: "
               + classType
               + ".  If this is a class that is already compiled, you either need to specify an 'api-import' "
               + "element in the configuration file, or your class needs to be explicitly exported. See the FAQ "
               + "( http://tinyurl.com/cte3oq ) for details.";
     }
   }
 }