1 package org.apache.beehive.wsm.processor.apt; 2 3 20 21 import java.util.Collection ; 22 23 import org.apache.beehive.wsm.model.BeehiveWsSOAPBindingInfo; 24 import org.apache.beehive.wsm.model.BeehiveWsTypeMetadata; 25 import org.apache.beehive.wsm.model.BeehiveWsMethodMetadata; 26 import org.apache.beehive.wsm.model.BeehiveWsParameterMetadata; 27 28 public class WebServiceMetadataViewer { 29 30 private static String [] TABS = new String []{ 32 "", 33 " ", 34 " ", 35 " ", 36 " ", 37 " " 38 }; 39 40 public static void print(BeehiveWsTypeMetadata webServiceTYPEMetadata) { 41 print(0, webServiceTYPEMetadata); 42 } 43 44 public static void print(int tab, BeehiveWsTypeMetadata webServiceTYPEMetadata) { 45 print(tab, "<TYPE > > >WebServiceTYPEMetadata"); 46 print(tab, "wsName", webServiceTYPEMetadata.getWsName()); 47 print(tab, "wsServiceName", webServiceTYPEMetadata.getWsServiceName()); 48 print(tab, "wsWsdlLocation", webServiceTYPEMetadata.getWsWsdlLocation()); 49 print(tab, "wsTargetNamespace", webServiceTYPEMetadata.getWsTargetNamespace()); 50 print(tab, "wsEndpointInterface", webServiceTYPEMetadata.getWsEndpointInterface()); 51 print(tab, "hcFileName", webServiceTYPEMetadata.getHcFileName()); 52 print(tab, "hcName", webServiceTYPEMetadata.getHcName()); 53 print(""); 56 tab++; 57 print(tab, webServiceTYPEMetadata.getMethods()); 58 print(tab, webServiceTYPEMetadata.getSoapBinding()); 59 } 60 61 public static void print(Collection collection) { 62 print(0, collection); 63 } 64 65 public static void print(int tab, Collection collection) { 66 if (collection == null) 67 return; 68 for (Object element : collection) { 69 if (element instanceof BeehiveWsTypeMetadata) { 70 print(tab, (BeehiveWsTypeMetadata) element); 71 } else if (element instanceof BeehiveWsMethodMetadata) { 72 print(tab, (BeehiveWsMethodMetadata) element); 73 } else if (element instanceof BeehiveWsParameterMetadata) { 74 print(tab, (BeehiveWsParameterMetadata) element); 75 } 76 } 77 } 78 79 public static void print(BeehiveWsMethodMetadata webServiceMETHODMetadata) { 80 print(0, webServiceMETHODMetadata); 81 } 82 83 public static void print(int tab, BeehiveWsMethodMetadata webServiceMETHODMetadata) { 84 if (webServiceMETHODMetadata == null) 85 return; 86 print(tab, "<METHOD > > > > > >WebServiceMETHODMetadata"); 87 print(tab, "wmOperationName", webServiceMETHODMetadata.getWmOperationName()); 88 print(tab, "wmAction", webServiceMETHODMetadata.getWmAction()); 89 print(tab, "oneway", webServiceMETHODMetadata.isOneWay() ? "true" : "false"); 90 print(tab, "wrName", webServiceMETHODMetadata.getWrName()); 91 print(tab, "javaMethodName", webServiceMETHODMetadata.getJavaMethodName()); 92 print(tab, "javaReturnType", webServiceMETHODMetadata.getJavaReturnType()); 93 94 98 101 print(""); 102 tab++; 103 print(tab, webServiceMETHODMetadata.getParams()); 104 } 105 106 public static void print(BeehiveWsParameterMetadata webServicePARAMETERMetadata) { 107 print(0, webServicePARAMETERMetadata); 108 } 109 110 public static void print(int tab, BeehiveWsParameterMetadata webServicePARAMETERMetadata) { 111 if (webServicePARAMETERMetadata == null) 112 return; 113 print(tab, "<PARAM > > > > > > > > >WebServicePARAMETERMetadata"); 114 print(tab, "wpName", webServicePARAMETERMetadata.getWpName()); 115 print(tab, "wpMode", webServicePARAMETERMetadata.getWpMode()); 116 print(tab, "wpHeader", webServicePARAMETERMetadata.isWpHeader() ? "true" : "false"); 117 print(tab, "javaType", webServicePARAMETERMetadata.getJavaType()); 118 120 print(""); 121 } 122 123 public static void print(BeehiveWsSOAPBindingInfo soapBindingInfo) { 124 print(0, soapBindingInfo); 125 } 126 127 public static void print(int tab, BeehiveWsSOAPBindingInfo soapBindingInfo) { 128 if (soapBindingInfo == null) 129 return; 130 print(tab, ">SOAPBindingInfo"); 131 print(tab, "style", soapBindingInfo.getStyle()); 132 print(tab, "use", soapBindingInfo.getUse()); 133 print(tab, "style", soapBindingInfo.getParameterStyle()); 134 } 135 136 137 138 public static void print(int tab, String msg, Object data) { 139 print(tab, msg + " : " + data); 140 } 141 142 public static void print(int tab, String msg) { 143 print(TABS[tab] + msg); 144 } 145 146 public static void print(String msg) { 147 System.out.println(msg); 148 } 149 150 } 151 | Popular Tags |