Codota Logo
org.restlet.ext.platform.internal.conversion.raml
Code IndexAdd Codota to your IDE (free)

How to use org.restlet.ext.platform.internal.conversion.raml

Best Java code snippets using org.restlet.ext.platform.internal.conversion.raml (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * Gets the parent resource of a Resource given its path and the list of
 * paths available on the API.
 * 
 * @param paths
 *            The list of paths available on the API.
 * @param resourcePath
 *            The path of the resource the parent resource is searched for.
 * @param raml
 *            The RAML representing the API.
 * @return The parent resource.
 */
public static Resource getParentResource(List<String> paths,
    String resourcePath, Raml raml) {
  List<String> parentPaths = new ArrayList<String>();
  parentPaths.addAll(paths);
  parentPaths.add(resourcePath);
  Collections.sort(parentPaths);
  int index = parentPaths.indexOf(resourcePath);
  if (index != 0) {
    String parentPath = parentPaths.get(index - 1);
    if (resourcePath.startsWith(parentPath)) {
      return getResourceByCompletePath(raml, parentPath);
    }
  }
  return null;
}
origin: org.restlet.jee/org.restlet.ext.platform

/**
 * Returns the list of
 * {@link org.restlet.ext.platform.internal.model.PathVariable} as defined
 * by the given {@link org.raml.model.Resource}.
 * 
 * @param resource
 *            The given resource.
 * @return The list of
 *         {@link org.restlet.ext.platform.internal.model.PathVariable} as
 *         defined by the given {@link org.raml.model.Resource}.
 */
private static List<PathVariable> getPathVariables(
    org.raml.model.Resource resource) {
  List<PathVariable> pathVariables = new ArrayList<>();
  for (Entry<String, UriParameter> entry : resource.getUriParameters()
      .entrySet()) {
    pathVariables
        .add(getPathVariable(entry.getKey(), entry.getValue()));
  }
  if (resource.getParentResource() != null) {
    pathVariables
        .addAll(getPathVariables(resource.getParentResource()));
  }
  return pathVariables;
}
origin: org.restlet.jee/org.restlet.ext.platform

/**
 * Generates the JsonSchema of a Representation.
 * 
 * @param representation
 *            The representation.
 * @param schemas
 * @param m
 * @throws JsonProcessingException
 */
public static void fillSchemas(Representation representation,
    Map<String, String> schemas, ObjectMapper m)
    throws JsonProcessingException {
  fillSchemas(representation.getName(), representation.getDescription(),
      representation.isRaw(), representation.getExtendedType(),
      representation.getProperties(), schemas, m);
}
origin: org.restlet.jse/org.restlet.ext.platform

Map<String, Map<String, Object>> representationSamples = getSamples(contract);
raml.setSecuritySchemes(getSecuritySchemes(endpoint));
fillResources(raml.getResources(), m, contract, representationSamples);
raml.getSchemas().add(schemas);
for (Representation representation : contract.getRepresentations()) {
  if (RamlUtils.isPrimitiveType(representation.getName())) {
    continue;
    RamlUtils.fillSchemas(representation, schemas, m);
  } catch (JsonProcessingException e) {
    LOGGER.log(Level.WARNING,
origin: org.restlet.jse/org.restlet.ext.platform

  Action action, Operation operation, MimeType ramlInRepresentation) {
ramlInRepresentation.setType(operation.getInputPayLoad().getType());
if (RamlUtils.isPrimitiveType(operation.getInputPayLoad().getType())) {
  Property inRepresentationPrimitive = new Property();
  inRepresentationPrimitive.setName("");
      .getType());
  SimpleTypeSchema inRepresentationSchema = RamlUtils
      .generatePrimitiveSchema(inRepresentationPrimitive);
  try {
    ramlInRepresentation.setSchema(m
  try {
    ramlInRepresentationWithMediaType
        .setExample(getExampleFromPayLoad(
            operation.getInputPayLoad(),
            representationSamples, mediaType));
origin: org.restlet.jee/org.restlet.ext.platform

Map<String, Map<String, Object>> representationSamples = getSamples(contract);
raml.setSecuritySchemes(getSecuritySchemes(endpoint));
fillResources(raml.getResources(), m, contract, representationSamples);
raml.getSchemas().add(schemas);
for (Representation representation : contract.getRepresentations()) {
  if (RamlUtils.isPrimitiveType(representation.getName())) {
    continue;
    RamlUtils.fillSchemas(representation, schemas, m);
  } catch (JsonProcessingException e) {
    LOGGER.log(Level.WARNING,
origin: org.restlet.osgi/org.restlet.ext.platform

  Action action, Operation operation, MimeType ramlInRepresentation) {
ramlInRepresentation.setType(operation.getInputPayLoad().getType());
if (RamlUtils.isPrimitiveType(operation.getInputPayLoad().getType())) {
  Property inRepresentationPrimitive = new Property();
  inRepresentationPrimitive.setName("");
      .getType());
  SimpleTypeSchema inRepresentationSchema = RamlUtils
      .generatePrimitiveSchema(inRepresentationPrimitive);
  try {
    ramlInRepresentation.setSchema(m
  try {
    ramlInRepresentationWithMediaType
        .setExample(getExampleFromPayLoad(
            operation.getInputPayLoad(),
            representationSamples, mediaType));
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * Returns the list of
 * {@link org.restlet.ext.platform.internal.model.PathVariable} as defined
 * by the given {@link org.raml.model.Resource}.
 * 
 * @param resource
 *            The given resource.
 * @return The list of
 *         {@link org.restlet.ext.platform.internal.model.PathVariable} as
 *         defined by the given {@link org.raml.model.Resource}.
 */
private static List<PathVariable> getPathVariables(
    org.raml.model.Resource resource) {
  List<PathVariable> pathVariables = new ArrayList<>();
  for (Entry<String, UriParameter> entry : resource.getUriParameters()
      .entrySet()) {
    pathVariables
        .add(getPathVariable(entry.getKey(), entry.getValue()));
  }
  if (resource.getParentResource() != null) {
    pathVariables
        .addAll(getPathVariables(resource.getParentResource()));
  }
  return pathVariables;
}
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * Generates the JsonSchema of a Representation.
 * 
 * @param representation
 *            The representation.
 * @param schemas
 * @param m
 * @throws JsonProcessingException
 */
public static void fillSchemas(Representation representation,
    Map<String, String> schemas, ObjectMapper m)
    throws JsonProcessingException {
  fillSchemas(representation.getName(), representation.getDescription(),
      representation.isRaw(), representation.getExtendedType(),
      representation.getProperties(), schemas, m);
}
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * Gets the parent resource of a Resource given its path and the list of
 * paths available on the API.
 * 
 * @param paths
 *            The list of paths available on the API.
 * @param resourcePath
 *            The path of the resource the parent resource is searched for.
 * @param raml
 *            The RAML representing the API.
 * @return The parent resource.
 */
public static Resource getParentResource(List<String> paths,
    String resourcePath, Raml raml) {
  List<String> parentPaths = new ArrayList<String>();
  parentPaths.addAll(paths);
  parentPaths.add(resourcePath);
  Collections.sort(parentPaths);
  int index = parentPaths.indexOf(resourcePath);
  if (index != 0) {
    String parentPath = parentPaths.get(index - 1);
    if (resourcePath.startsWith(parentPath)) {
      return getResourceByCompletePath(raml, parentPath);
    }
  }
  return null;
}
origin: org.restlet.gae/org.restlet.ext.platform

Map<String, Map<String, Object>> representationSamples = getSamples(contract);
raml.setSecuritySchemes(getSecuritySchemes(endpoint));
fillResources(raml.getResources(), m, contract, representationSamples);
raml.getSchemas().add(schemas);
for (Representation representation : contract.getRepresentations()) {
  if (RamlUtils.isPrimitiveType(representation.getName())) {
    continue;
    RamlUtils.fillSchemas(representation, schemas, m);
  } catch (JsonProcessingException e) {
    LOGGER.log(Level.WARNING,
origin: org.restlet.jee/org.restlet.ext.platform

  Action action, Operation operation, MimeType ramlInRepresentation) {
ramlInRepresentation.setType(operation.getInputPayLoad().getType());
if (RamlUtils.isPrimitiveType(operation.getInputPayLoad().getType())) {
  Property inRepresentationPrimitive = new Property();
  inRepresentationPrimitive.setName("");
      .getType());
  SimpleTypeSchema inRepresentationSchema = RamlUtils
      .generatePrimitiveSchema(inRepresentationPrimitive);
  try {
    ramlInRepresentation.setSchema(m
  try {
    ramlInRepresentationWithMediaType
        .setExample(getExampleFromPayLoad(
            operation.getInputPayLoad(),
            representationSamples, mediaType));
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * Returns the list of
 * {@link org.restlet.ext.platform.internal.model.PathVariable} as defined
 * by the given {@link org.raml.model.Resource}.
 * 
 * @param resource
 *            The given resource.
 * @return The list of
 *         {@link org.restlet.ext.platform.internal.model.PathVariable} as
 *         defined by the given {@link org.raml.model.Resource}.
 */
private static List<PathVariable> getPathVariables(
    org.raml.model.Resource resource) {
  List<PathVariable> pathVariables = new ArrayList<>();
  for (Entry<String, UriParameter> entry : resource.getUriParameters()
      .entrySet()) {
    pathVariables
        .add(getPathVariable(entry.getKey(), entry.getValue()));
  }
  if (resource.getParentResource() != null) {
    pathVariables
        .addAll(getPathVariables(resource.getParentResource()));
  }
  return pathVariables;
}
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * Generates the JsonSchema of a Representation.
 * 
 * @param representation
 *            The representation.
 * @param schemas
 * @param m
 * @throws JsonProcessingException
 */
public static void fillSchemas(Representation representation,
    Map<String, String> schemas, ObjectMapper m)
    throws JsonProcessingException {
  fillSchemas(representation.getName(), representation.getDescription(),
      representation.isRaw(), representation.getExtendedType(),
      representation.getProperties(), schemas, m);
}
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * Gets the parent resource of a Resource given its path and the list of
 * paths available on the API.
 * 
 * @param paths
 *            The list of paths available on the API.
 * @param resourcePath
 *            The path of the resource the parent resource is searched for.
 * @param raml
 *            The RAML representing the API.
 * @return The parent resource.
 */
public static Resource getParentResource(List<String> paths,
    String resourcePath, Raml raml) {
  List<String> parentPaths = new ArrayList<String>();
  parentPaths.addAll(paths);
  parentPaths.add(resourcePath);
  Collections.sort(parentPaths);
  int index = parentPaths.indexOf(resourcePath);
  if (index != 0) {
    String parentPath = parentPaths.get(index - 1);
    if (resourcePath.startsWith(parentPath)) {
      return getResourceByCompletePath(raml, parentPath);
    }
  }
  return null;
}
origin: org.restlet.osgi/org.restlet.ext.platform

Map<String, Map<String, Object>> representationSamples = getSamples(contract);
raml.setSecuritySchemes(getSecuritySchemes(endpoint));
fillResources(raml.getResources(), m, contract, representationSamples);
raml.getSchemas().add(schemas);
for (Representation representation : contract.getRepresentations()) {
  if (RamlUtils.isPrimitiveType(representation.getName())) {
    continue;
    RamlUtils.fillSchemas(representation, schemas, m);
  } catch (JsonProcessingException e) {
    LOGGER.log(Level.WARNING,
origin: org.restlet.gae/org.restlet.ext.platform

  Action action, Operation operation, MimeType ramlInRepresentation) {
ramlInRepresentation.setType(operation.getInputPayLoad().getType());
if (RamlUtils.isPrimitiveType(operation.getInputPayLoad().getType())) {
  Property inRepresentationPrimitive = new Property();
  inRepresentationPrimitive.setName("");
      .getType());
  SimpleTypeSchema inRepresentationSchema = RamlUtils
      .generatePrimitiveSchema(inRepresentationPrimitive);
  try {
    ramlInRepresentation.setSchema(m
  try {
    ramlInRepresentationWithMediaType
        .setExample(getExampleFromPayLoad(
            operation.getInputPayLoad(),
            representationSamples, mediaType));
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * Returns the list of
 * {@link org.restlet.ext.platform.internal.model.PathVariable} as defined
 * by the given {@link org.raml.model.Resource}.
 * 
 * @param resource
 *            The given resource.
 * @return The list of
 *         {@link org.restlet.ext.platform.internal.model.PathVariable} as
 *         defined by the given {@link org.raml.model.Resource}.
 */
private static List<PathVariable> getPathVariables(
    org.raml.model.Resource resource) {
  List<PathVariable> pathVariables = new ArrayList<>();
  for (Entry<String, UriParameter> entry : resource.getUriParameters()
      .entrySet()) {
    pathVariables
        .add(getPathVariable(entry.getKey(), entry.getValue()));
  }
  if (resource.getParentResource() != null) {
    pathVariables
        .addAll(getPathVariables(resource.getParentResource()));
  }
  return pathVariables;
}
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * Generates the JsonSchema of a Representation.
 * 
 * @param representation
 *            The representation.
 * @param schemas
 * @param m
 * @throws JsonProcessingException
 */
public static void fillSchemas(Representation representation,
    Map<String, String> schemas, ObjectMapper m)
    throws JsonProcessingException {
  fillSchemas(representation.getName(), representation.getDescription(),
      representation.isRaw(), representation.getExtendedType(),
      representation.getProperties(), schemas, m);
}
origin: org.restlet.jee/org.restlet.ext.platform

/**
 * Gets the parent resource of a Resource given its path and the list of
 * paths available on the API.
 * 
 * @param paths
 *            The list of paths available on the API.
 * @param resourcePath
 *            The path of the resource the parent resource is searched for.
 * @param raml
 *            The RAML representing the API.
 * @return The parent resource.
 */
public static Resource getParentResource(List<String> paths,
    String resourcePath, Raml raml) {
  List<String> parentPaths = new ArrayList<String>();
  parentPaths.addAll(paths);
  parentPaths.add(resourcePath);
  Collections.sort(parentPaths);
  int index = parentPaths.indexOf(resourcePath);
  if (index != 0) {
    String parentPath = parentPaths.get(index - 1);
    if (resourcePath.startsWith(parentPath)) {
      return getResourceByCompletePath(raml, parentPath);
    }
  }
  return null;
}
org.restlet.ext.platform.internal.conversion.raml

Most used classes

  • RamlTranslator
    Tools library for converting Restlet Web API Definition to and from RAML documentation.
  • RamlUtils
    Utility class for RAML java beans.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now