Search in sources :

Example 1 with SServiceParameter

use of org.bimserver.interfaces.objects.SServiceParameter in project BIMserver by opensourceBIM.

the class MetaServiceImpl method getServiceMethodParameters.

@Override
public List<SServiceParameter> getServiceMethodParameters(String serviceInterfaceName, String serviceMethodName) throws ServerException, UserException {
    List<SServiceParameter> sServiceParameters = new ArrayList<SServiceParameter>();
    SService serviceInterface = getBimServer().getServicesMap().getByName(serviceInterfaceName);
    if (serviceInterface == null) {
        throw new UserException("Service \"" + serviceInterfaceName + "\" not found");
    }
    SMethod sMethod = serviceInterface.getSMethod(serviceMethodName);
    if (sMethod == null) {
        throw new UserException("Method \"" + serviceMethodName + "\" not found in \"" + serviceInterfaceName + "\"");
    }
    for (SParameter sParameter : sMethod.getParameters()) {
        SServiceParameter sServiceParameter = new SServiceParameter();
        sServiceParameter.setName(sParameter.getName());
        sServiceParameter.setDoc(sParameter.getDoc());
        sServiceParameter.setType(createSServiceType(sParameter.getType(), false));
        sServiceParameter.setGenericType(createSServiceType(sParameter.getGenericType(), false));
        sServiceParameters.add(sServiceParameter);
    }
    return sServiceParameters;
}
Also used : SParameter(org.bimserver.shared.meta.SParameter) SServiceParameter(org.bimserver.interfaces.objects.SServiceParameter) ArrayList(java.util.ArrayList) UserException(org.bimserver.shared.exceptions.UserException) SMethod(org.bimserver.shared.meta.SMethod) SService(org.bimserver.shared.meta.SService)

Aggregations

ArrayList (java.util.ArrayList)1 SServiceParameter (org.bimserver.interfaces.objects.SServiceParameter)1 UserException (org.bimserver.shared.exceptions.UserException)1 SMethod (org.bimserver.shared.meta.SMethod)1 SParameter (org.bimserver.shared.meta.SParameter)1 SService (org.bimserver.shared.meta.SService)1