docConfig.getDomNode().appendChild( docConfig.getDomNode().getOwnerDocument().createTextNode( description ) );
}
private void generateWadlMethod( Resource resourceConfig, RestMethod restMethod )
{
Method methodConfig = resourceConfig.addNewMethod();
createDoc( methodConfig.addNewDoc(), restMethod );
methodConfig.setName( restMethod.getMethod().toString() );
methodConfig.setId( restMethod.getName() );
Request requestConfig = methodConfig.addNewRequest();
Map<String, RestParamProperty> defaultParams = new HashMap<String, RestParamProperty>();
for( RestParamProperty defaultParam : restMethod.getResource().getDefaultParams() )
defaultParams.put( defaultParam.getName(), defaultParam );
RestParamsPropertyHolder params = restMethod.getParams();
for( int c = 0; c < params.size(); c++ )
{
RestParamProperty param = params.getPropertyAt( c );
if( !defaultParams.containsKey( param.getName() ) || !param.equals( defaultParams.get( param.getName() ) ) )
generateParam( requestConfig.addNewParam(), param );
}
if( restMethod.hasRequestBody() )
{
for( RestRepresentation representation : restMethod.getRepresentations( RestRepresentation.Type.REQUEST, null ) )
{
generateRepresentation( requestConfig.addNewRepresentation(), representation );
}
}
Map<String, Response> responses = new HashMap<String, Response>();
if( !isWADL11 )
responses.put( null, methodConfig.addNewResponse() );
for( RestRepresentation representation : restMethod.getRepresentations() )
{
Response response;
if( isWADL11 )
{
List<Comparable> status = new ArrayList<Comparable>( ( List<Comparable> )representation.getStatus() );
Collections.sort( status );
StringBuilder statusStrBuilder = new StringBuilder();
for( Object o : status )
statusStrBuilder.append( o ).append( " " );
String statusStr = statusStrBuilder.toString();
if( !responses.containsKey( statusStr ) )
{
response = methodConfig.addNewResponse();
response.setStatus( status );
responses.put( statusStr, response );
}
else
{