Tabnine Logo
com.lyncode.xoai.dataprovider.model
Code IndexAdd Tabnine to your IDE (free)

How to use com.lyncode.xoai.dataprovider.model

Best Java code snippets using com.lyncode.xoai.dataprovider.model (Showing top 20 results out of 315)

origin: com.lyncode/xoai-data-provider

public Context withMetadataFormat(String prefix, Transformer transformer, Condition condition) {
  withMetadataFormat(
      new MetadataFormat()
          .withNamespace(prefix)
          .withPrefix(prefix)
          .withSchemaLocation(prefix)
          .withTransformer(transformer)
          .withCondition(condition)
  );
  return this;
}
origin: IQSS/dataverse

private Context addDataverseJsonMetadataFormat(Context context) {
  MetadataFormat metadataFormat = MetadataFormat.metadataFormat(DATAVERSE_EXTENDED_METADATA_FORMAT);
  metadataFormat.withNamespace(DATAVERSE_EXTENDED_METADATA_INFO);
  metadataFormat.withSchemaLocation(DATAVERSE_EXTENDED_METADATA_SCHEMA);
  context.withMetadataFormat(metadataFormat);
  return context;
}

origin: com.lyncode/xoai-data-provider

  public InMemoryItem withIdentifier(String identifier) {
    this.with("identifier", identifier);
    return this;
  }
}
origin: com.lyncode/xoai-data-provider

private List<ScopedFilter> getScopedFilters(Context context, String metadataPrefix) throws CannotDisseminateFormatException {
  List<ScopedFilter> filters = new ArrayList<ScopedFilter>();
  if (context.hasCondition())
    filters.add(new ScopedFilter(context.getCondition(), Scope.Context));
  MetadataFormat metadataFormat = context.formatForPrefix(metadataPrefix);
  if (metadataFormat.hasCondition())
    filters.add(new ScopedFilter(metadataFormat.getCondition(), Scope.MetadataFormat));
  return filters;
}
origin: com.lyncode/xoai-data-provider

  public List<Set> getSets(Context context, FilterResolver resolver) {
    List<Set> result = new ArrayList<Set>();
    for (Set set : context.getSets())
      if (set.getCondition().getFilter(resolver).isItemShown(item))
        result.add(set);

    result.addAll(item.getSets());

    return result;
  }
}
origin: com.lyncode/xoai-data-provider

public InMemorySetRepository withSet(String name, String spec) {
  this.sets.add(new Set(spec).withName(name));
  return this;
}
origin: com.lyncode/xoai-data-provider

public boolean exists(Context context, String setSpec) {
  List<Set> statics = context.getSets();
  for (Set set : statics)
    if (set.getSpec().equals(set))
      return true;
  return setRepository.exists(setSpec);
}
origin: com.lyncode/xoai-data-provider

public boolean isStaticSet(String setSpec) {
  for (Set set : this.sets)
    if (set.getSpec().equals(setSpec))
      return true;
  return false;
}
origin: com.lyncode/xoai-data-provider

  @Override
  public com.lyncode.xoai.dataprovider.model.Set apply(String elem) {
    return new com.lyncode.xoai.dataprovider.model.Set(elem);
  }
});
origin: com.lyncode/xoai-data-provider

public static Context context () {
  return new Context();
}
origin: com.lyncode/xoai-data-provider

public static MetadataFormat metadataFormat (String prefix) {
  return new MetadataFormat().withPrefix(prefix);
}
origin: com.lyncode/xoai-data-provider

public boolean hasSet(String set) {
  return isStaticSet(set);
}
origin: com.lyncode/xoai-data-provider

public static InMemoryItem item () {
  return new InMemoryItem();
}
origin: com.lyncode/xoai-data-provider

public MetadataFormat formatForPrefix(String metadataPrefix) {
  for (MetadataFormat format : this.metadataFormats)
    if (format.getPrefix().equals(metadataPrefix))
      return format;
  return null;
}
origin: com.lyncode/xoai-data-provider

public InMemoryItemRepository withRandomItems(int number) {
  for (int i = 0; i < number; i++)
    list.add(InMemoryItem.randomItem());
  return this;
}
origin: com.lyncode/xoai-data-provider

public Context withMetadataFormat(String prefix, Transformer transformer) {
  withMetadataFormat(new MetadataFormat().withNamespace(prefix).withPrefix(prefix).withSchemaLocation(prefix).withTransformer(transformer));
  return this;
}
origin: com.lyncode/xoai-data-provider

  @Override
  public boolean exists(String setSpec) {
    for (Set s : this.sets)
      if (s.getSpec().equals(setSpec))
        return true;

    return false;
  }
}
origin: com.lyncode/xoai-data-provider

public static Set set (String spec) {
  return new Set(spec);
}
origin: IQSS/dataverse

private Context createContext() {
  
  Context context = new Context();
  addSupportedMetadataFormats(context);
  return context;
}

origin: com.lyncode/xoai-data-provider

public Set getSet(String setSpec) {
  for (Set set : this.sets)
    if (set.getSpec().equals(setSpec))
      return set;
  return null;
}
com.lyncode.xoai.dataprovider.model

Most used classes

  • Context
  • Item
    This is a required class to extend when implementing a specific OAI Data Provider. It works as a wra
  • MetadataFormat
  • Set
  • Condition
  • ItemIdentifier
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