diff src/main/resources/org/ssdt_ohio/gradle/userdoc/templates/classDocName.html @ 15:e3c55e83c9a4

USASR-1307: start custom class/property displays
author Dave Smith <smith@nwoca.org>
date Fri, 17 Jan 2014 18:16:29 +0000
parents 9de72de14ab3
children 8400a7db1330
line wrap: on
line diff
--- a/src/main/resources/org/ssdt_ohio/gradle/userdoc/templates/classDocName.html	Tue Dec 10 23:24:56 2013 +0000
+++ b/src/main/resources/org/ssdt_ohio/gradle/userdoc/templates/classDocName.html	Fri Jan 17 18:16:29 2014 +0000
@@ -5,6 +5,10 @@
 <!-- *  i.e. only iterate & print data where possible. Thanks, Jez. * -->
 <!-- **************************************************************** -->
 <%
+        
+        
+    classDoc = new org.ssdt_ohio.gradle.doc.tools.UserClassDocProxy().wrap(classDoc)
+
     def title = classDoc.name() + (props.docTitle ? " (${props.docTitle})" : "")
     def isVisible = { it.isPublic() || (it.isProtected() && props.protectedScope == 'true') || (!it.isProtected() && !it.isPrivate() && props.packageScope == 'true') || props.privateScope == 'true' }
     def isVisibleExt = { t -> java.lang.reflect.Modifier.isPublic(t.modifiers) || java.lang.reflect.Modifier.isProtected(t.modifiers) }
@@ -22,7 +26,7 @@
     def dolink = { t, boolean b ->
         boolean isArray = false
         if (!t || t instanceof String) {
-            return classDoc.getDocUrl(t, b)
+            return (classDoc.getDocUrl(t, b)  -'java.util.' - 'java.lang.')
         }
         if (t instanceof org.codehaus.groovy.tools.groovydoc.ArrayClassDocWrapper) {
             t = t.delegate
@@ -30,9 +34,9 @@
         }
         if (t instanceof org.codehaus.groovy.tools.groovydoc.SimpleGroovyClassDoc) {
             if (t.fullPathName == 'def') return classDoc.getDocUrl("java.lang.Object def", b)
-            return "<a href='" + classDoc.relativeRootPath + t.fullPathName + ".html'>" + (b ? t.qualifiedTypeName() : t.name()) + "</a>" + (isArray ? "[]" : "")
+            return "<a href='" + classDoc.relativeRootPath + t.fullPathName + ".html'>" + ( (b ? t.qualifiedTypeName() : t.name() ) - "java.lang." - "java.util." ) + "</a>" + (isArray ? "[]" : "")
         }
-        return classDoc.getDocUrl(t.qualifiedTypeName(), b) + (isArray ? "[]" : "")
+        return ( classDoc.getDocUrl(t.qualifiedTypeName(), b) - 'java.util.' - 'java.lang.' ) + (isArray ? "[]" : "")
     }
     def linkfull = { t -> dolink(t, true) }
     def linkable = { t -> dolink(t, false) }
@@ -52,7 +56,7 @@
     }
     def annotations = { t, sepChar ->
         t.annotations() ? t.annotations().collect {
-    //        it.isTypeAvailable() ? '@'+linkable(it.type().name())+(it.description()-('@'+it.type().name())): it.description()
+//        it.isTypeAvailable() ? '@'+linkable(it.type().name())+(it.description()-('@'+it.type().name())): it.description()
             it.description()
         }.join(sepChar) + sepChar : ''
     }
@@ -60,7 +64,9 @@
         "required":"true",
         "optional":"false"
     ]
-    def isRequired = { f, v -> def req = f.constantValueExpression() == null; req.toString() == v }
+    def isRequired = { f, v ->
+        def req = f.constantValueExpression() == null; req.toString() == v
+    }
     def upcase = { n -> n[0].toUpperCase() + n[1..-1] }
     def paramsOf = { n, boolean brief -> n.parameters().collect{ param -> (brief?'':annotations(param, ' ')) + linkable(param.isTypeAvailable()?param.type():param.typeName()) + (param.vararg()?'... ':' ') + param.name() + (param.defaultValue() ? " = " + param.defaultValue():"") }.join(", ") }
     def nameFromParams = { n -> n.name() + '(' + n.parameters().collect{ param -> param.isTypeAvailable()?param.type().qualifiedTypeName():param.typeName() }.join(', ') + ')' }