Tabnine Logo
Yawp
Code IndexAdd Tabnine to your IDE (free)

How to use
Yawp
in
io.yawp.repository

Best Java code snippets using io.yawp.repository.Yawp (Showing top 20 results out of 315)

origin: feroult/yawp

public T get() {
  if (object == null && json == null) {
    return null;
  }
  if (object == null) {
    object = (T) JsonUtils.from(Yawp.yawp(), json, type);
  }
  return object;
}
origin: feroult/yawp

public static Repository yawp() {
  init();
  return yawp.get();
}
origin: feroult/yawp

@Override
public void destroy() {
  super.destroy();
  Yawp.destroyFeatures();
}
origin: feroult/yawp

protected Repository initYawp() {
  String appPackage = getAppPackage();
  if (appPackage != null) {
    Yawp.init(appPackage);
  }
  return Yawp.yawp();
}
origin: feroult/yawp

private static void init() {
  if (yawp.get() != null) {
    return;
  }
  if (features == null) {
    safeLoadFeaturesFromConfig();
  }
  yawp.set(Repository.r().setFeatures(features));
}
origin: feroult/yawp

@Test
public void testSimpleRepositoryAccess() {
  Yawp.yawp.save(new BasicObject("xpto"));
  BasicObject retrievedObject = Yawp.yawp(BasicObject.class).first();
  assertEquals("xpto", retrievedObject.getStringValue());
}
origin: feroult/yawp

private Set<Class<?>> scanEndpointClazzes() {
  WebConfiguration webConfiguration = new WebConfiguration(getWebConfigFile());
  if (webConfiguration.getPackagePrefix() != null) {
    Yawp.init(webConfiguration.getPackagePrefix());
  }
  return yawp.getFeatures().getEndpointClazzes();
}
origin: feroult/yawp

/**
 * @deprecated in 2.0, yawp will be configured only by yawp.yml
 */
@Deprecated
private void initYawp(String packagePrefix) {
  if (packagePrefix == null) {
    return;
  }
  Yawp.init(packagePrefix);
}
origin: feroult/yawp

public static void init(String packagePrefix) {
  if (yawp.get() != null) {
    return;
  }
  if (features == null) {
    safeLoadFeatures(packagePrefix);
  }
  yawp.set(Repository.r().setFeatures(features));
}
origin: feroult/yawp

@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
  if (!enableFixtures()) {
    response(resp, new ExceptionResponse(403));
    return;
  }
  Yawp.yawp.namespace(req.getHeader("namespace"));
  super.service(req, resp);
}
origin: feroult/yawp

public HttpResponse execute(RequestContext ctx) {
  try {
    Cache.clearAll();
    Repository r = getRepository(ctx);
    EndpointRouter router = EndpointRouter.parse(r, ctx);
    if (!router.isValid()) {
      throw new HttpException(400, "Invalid route. Please check uri, json format, object ids and parent structure, etc.");
    }
    return router.executeRestAction(enableShields);
  } finally {
    Yawp.dispose();
  }
}
origin: feroult/yawp

public IdRef<?> getSinkId() {
  if (sinkId == null) {
    sinkId = IdRef.parse(yawp(), sinkUri);
  }
  return sinkId;
}
origin: feroult/yawp

@Override
public <T> T fetch(IdRef<T> id) {
  init();
  return get().fetch(id);
}
origin: feroult/yawp

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
  String uri = (String) in.readObject();
  IdRef<T> idRef = (IdRef<T>) parse(yawp(), uri);
  this.r = idRef.r;
  this.clazz = idRef.clazz;
  this.model = idRef.model;
  this.id = idRef.id;
  this.name = idRef.name;
  this.parentId = idRef.parentId;
}
origin: feroult/yawp

@Override
public String currentNamespace() {
  init();
  return get().currentNamespace();
}
origin: feroult/yawp

private void init(Class<? extends Pipe> pipeClazz, String cursor) {
  this.r = yawp();
  this.pipeClazz = pipeClazz;
  this.sourceClazz = ReflectionUtils.getFeatureEndpointClazz(pipeClazz);
  this.cursor = cursor;
}
origin: feroult/yawp

@Override
public AsyncRepository async() {
  init();
  return get().async();
}
origin: feroult/yawp

private List<T> readObjects(ObjectInputStream in) throws IOException, ClassNotFoundException {
  List<String> jsonList = (List<String>) in.readObject();
  List<T> objects = new ArrayList<>();
  for (String json : jsonList) {
    objects.add((T) JsonUtils.from(Yawp.yawp(), json, clazz));
  }
  return objects;
}
origin: feroult/yawp

@Override
public <T> QueryBuilder<T> query(Class<T> clazz) {
  init();
  return get().query(clazz);
}
origin: feroult/yawp

private void init(Class<? extends Pipe> pipeClazz, String sourceUri) {
  this.r = yawp();
  this.pipeClazz = pipeClazz;
  this.sourceId = IdRef.parse(r, sourceUri);
}
io.yawp.repositoryYawp

Most used methods

  • yawp
  • init
  • destroyFeatures
  • dispose
  • get
  • getFeatures
  • namespace
  • safeLoadFeatures
  • safeLoadFeaturesFromConfig
  • save
  • set
  • set

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setRequestProperty (URLConnection)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now