Tabnine Logo
TypeUtils.getTypeClasses
Code IndexAdd Tabnine to your IDE (free)

How to use
getTypeClasses
method
in
uk.gov.dstl.baleen.uima.utils.TypeUtils

Best Java code snippets using uk.gov.dstl.baleen.uima.utils.TypeUtils.getTypeClasses (Showing top 9 results out of 315)

origin: dstl/baleen

/**
 * Get the given structure classes from by name or return all classes if null or empty
 *
 * @param typeNames the types to get
 * @return the structure classes
 * @throws ResourceInitializationException
 */
public static Set<Class<? extends Structure>> getStructureClasses(String... typeNames)
  throws ResourceInitializationException {
 return TypeUtils.getTypeClasses(Structure.class, typeNames);
}
origin: uk.gov.dstl.baleen/baleen-uima

/**
 * Get the given structure classes from by name or return all classes if null or empty
 *
 * @param typeNames the types to get
 * @return the structure classes
 * @throws ResourceInitializationException
 */
public static Set<Class<? extends Structure>> getStructureClasses(String... typeNames)
  throws ResourceInitializationException {
 return TypeUtils.getTypeClasses(Structure.class, typeNames);
}
origin: dstl/baleen

 @Test
 public void testCanGetTypeClass() throws ResourceInitializationException {
  Set<Class<? extends Entity>> typeClasses =
    TypeUtils.getTypeClasses(Entity.class, new String[] {Person.class.getSimpleName()});
  assertEquals(1, typeClasses.size());
  assertTrue(typeClasses.contains(Person.class));
 }
}
origin: dstl/baleen

@Test
public void testWhereNameEndMatches() throws UIMAException, BaleenException {
 Set<Class<? extends Structure>> c =
   TypeUtils.getTypeClasses(Structure.class, "Header", "TableHeader");
 assertEquals(2, c.size());
 assertTrue(c.contains(Header.class));
 assertTrue(c.contains(TableHeader.class));
}
origin: uk.gov.dstl.baleen/baleen-graph

@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 try {
  Set<Class<? extends Entity>> typeClasses = TypeUtils.getTypeClasses(Entity.class, typeNames);
  EntityGraphOptions.Builder builder =
    EntityGraphOptions.builder()
      .withContentHashAsId(contentHashAsId)
      .withEvents(outputEvents)
      .withStopFeatures(filterFeatures)
      .withAggregateProperties(aggregate)
      .withTypeClasses(typeClasses)
      .withMultiValueProperties(multiValueProperties)
      .withDefaultValueStrategy(createValueStrategy(defaultValueStrategyType))
      .withValueCoercer(valueCoercer);
  if (valueStrategyTypes != null) {
   for (int i = 0; i < valueStrategyTypes.length; i += 2) {
    builder.withValueStrategy(
      valueStrategyTypes[i], createValueStrategy(valueStrategyTypes[i + 1]));
   }
  }
  addOptions(builder);
  factory = new EntityGraphFactory(getMonitor(), builder.build());
 } catch (Exception e) {
  throw new ResourceInitializationException(e);
 }
}
origin: dstl/baleen

@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 try {
  Set<Class<? extends Entity>> typeClasses = TypeUtils.getTypeClasses(Entity.class, typeNames);
  EntityGraphOptions.Builder builder =
    EntityGraphOptions.builder()
      .withContentHashAsId(contentHashAsId)
      .withEvents(outputEvents)
      .withStopFeatures(filterFeatures)
      .withAggregateProperties(aggregate)
      .withTypeClasses(typeClasses)
      .withMultiValueProperties(multiValueProperties)
      .withDefaultValueStrategy(createValueStrategy(defaultValueStrategyType))
      .withValueCoercer(valueCoercer);
  if (valueStrategyTypes != null) {
   for (int i = 0; i < valueStrategyTypes.length; i += 2) {
    builder.withValueStrategy(
      valueStrategyTypes[i], createValueStrategy(valueStrategyTypes[i + 1]));
   }
  }
  addOptions(builder);
  factory = new EntityGraphFactory(getMonitor(), builder.build());
 } catch (Exception e) {
  throw new ResourceInitializationException(e);
 }
}
origin: uk.gov.dstl.baleen/baleen-graph

@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 Set<Class<? extends Entity>> typeClasses = TypeUtils.getTypeClasses(Entity.class, typeNames);
 DocumentGraphOptions.Builder builder =
   DocumentGraphOptions.builder()
     .withContentHashAsId(contentHashAsId)
     .withContent(outputContent)
     .withMeta(outputMeta)
     .withReferenceTargets(outputReferents)
     .withRelations(outputRelations)
     .withRelationsAsLinks(outputRelationsAsLinks)
     .withEvents(outputEvents)
     .withDocument(outputDocument)
     .withStopFeatures(filterFeatures)
     .withValueCoercer(valueCoercer)
     .withTypeClasses(typeClasses);
 addOptions(builder);
 factory = new DocumentGraphFactory(getMonitor(), builder.build());
}
origin: dstl/baleen

@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 Set<Class<? extends Entity>> typeClasses = TypeUtils.getTypeClasses(Entity.class, typeNames);
 DocumentGraphOptions.Builder builder =
   DocumentGraphOptions.builder()
     .withContentHashAsId(contentHashAsId)
     .withContent(outputContent)
     .withMeta(outputMeta)
     .withReferenceTargets(outputReferents)
     .withRelations(outputRelations)
     .withRelationsAsLinks(outputRelationsAsLinks)
     .withEvents(outputEvents)
     .withDocument(outputDocument)
     .withStopFeatures(filterFeatures)
     .withValueCoercer(valueCoercer)
     .withTypeClasses(typeClasses);
 addOptions(builder);
 factory = new DocumentGraphFactory(getMonitor(), builder.build());
}
origin: dstl/baleen

@Test
public void testDocumentGraphWithTypeFiltering() throws UIMAException {
 Set<Class<? extends Entity>> typeClasses =
   TypeUtils.getTypeClasses(Entity.class, Person.class.getSimpleName());
 DocumentGraphOptions options =
   DocumentGraphOptions.builder().withTypeClasses(typeClasses).build();
 DocumentGraphFactory factory = createfactory(options);
 JCas jCas = JCasFactory.createJCas();
 JCasTestGraphUtil.populateJcas(jCas);
 Graph graph = factory.create(jCas);
 assertEquals(2, graph.traversal().V().hasLabel(REFERENCE_TARGET).count().next().intValue());
 assertEquals(1, graph.traversal().V().hasLabel(EVENT).count().next().intValue());
 assertEquals(3, graph.traversal().V().hasLabel(MENTION).count().next().intValue());
 assertEquals(1, graph.traversal().V().hasLabel(RELATION).count().next().intValue());
 assertEquals(3, graph.traversal().E().hasLabel(MENTION_OF).count().next().intValue());
 assertEquals(2, graph.traversal().E().hasLabel(PARTICIPANT_IN).count().next().intValue());
 assertNoDocumentNode(graph);
 assertNoRelationEdges(graph);
 assertEquals(7, IteratorUtils.count(graph.vertices()));
 assertEquals(7, IteratorUtils.count(graph.edges()));
}
uk.gov.dstl.baleen.uima.utilsTypeUtilsgetTypeClasses

Javadoc

Get the given type classes by name or return all classes if null or empty

Popular methods of TypeUtils

  • getType
    For a given type name, look through the type system and return the matching class. If two types of t
  • filterAnnotations
    Filter the given annotations to only those contained in the given set
  • getAnnotationClasses
    Get the sub types of the given baleen annotation type
  • getClassFromType
  • getEntityClass
    Get the class of a specified type, that extends from the Entity base class

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Reference (javax.naming)
  • BoxLayout (javax.swing)
  • Top plugins for Android Studio
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