Package org.codehaus.enunciate.contract.json

Examples of org.codehaus.enunciate.contract.json.JsonType


    final Object object = BeansWrapper.getDefaultInstance().unwrap((TemplateModel) arguments.get(0));

    if (object instanceof String) {
      final String typeName = (String) object;
      final JsonType jsonType = model.findJsonTypeDefinition(typeName);
      return jsonSchemaForType(jsonType);
    }

    if (object instanceof ResourceRepresentationMetadata) {
      ResourceRepresentationMetadata metadata = (ResourceRepresentationMetadata) object;
      TypeMirror typeMirror = metadata.getDelegate();
      final JsonType jsonType = model.findJsonTypeDefinition(typeMirror.toString());
      return jsonSchemaForType(jsonType);
    }

    if (object instanceof TypeMirror) {
      TypeMirror typeMirror = (TypeMirror) object;
      final JsonType jsonType = model.findJsonTypeDefinition(typeMirror.toString());
      return jsonSchemaForType(jsonType);
    }

    if (object instanceof JsonType) {
      final JsonType jsonType = (JsonType) object;
      return jsonSchemaForType(jsonType);
    }

    if (object instanceof ResourceEntityParameter) {
      final ResourceEntityParameter restResourcePayload = (ResourceEntityParameter) object;
      final JsonType jsonType = restResourcePayload.getJsonType();
      return jsonSchemaForType(jsonType);
    }
    return null;
  }
View Full Code Here


    final Object object = BeansWrapper.getDefaultInstance().unwrap((TemplateModel) arguments.get(0));

    if (object instanceof String) {
      final String typeName = (String) object;
      final JsonType jsonType = model.findJsonTypeDefinition(typeName);
      if (jsonType != null) {
        return jsonType.getTypeName();
      }
      return typeName;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.codehaus.enunciate.contract.json.JsonType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.