Java Code Examples for org.apache.uima.util.InvalidXMLException#INVALID_CLASS

The following examples show how to use org.apache.uima.util.InvalidXMLException#INVALID_CLASS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public CpeDescription parseCpeDescription(XMLInputSource aInput) throws InvalidXMLException {
  XMLizable object = parse(aInput);

  if (object instanceof CpeDescription) {
    return (CpeDescription) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        CpeDescription.class.getName(), object.getClass().getName() });
  }
}
 
Example 2
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public IndexBuildSpecification parseIndexBuildSpecification(XMLInputSource aInput,
        ParsingOptions aOptions) throws InvalidXMLException {
  XMLizable object = parse(aInput, aOptions);

  if (object instanceof IndexBuildSpecification) {
    return (IndexBuildSpecification) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        IndexBuildSpecification.class.getName(), object.getClass().getName() });
  }
}
 
Example 3
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public PearSpecifier parsePearSpecifier(XMLInputSource aInput, ParsingOptions aOptions) throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof PearSpecifier) {
    return (PearSpecifier) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
            PearSpecifier.class.getName(), object.getClass().getName() });
  }
}
 
Example 4
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public CustomResourceSpecifier parseCustomResourceSpecifier(XMLInputSource aInput, ParsingOptions aOptions) throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof CustomResourceSpecifier) {
    return (CustomResourceSpecifier) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
            CustomResourceSpecifier.class.getName(), object.getClass().getName() });
  }
}
 
Example 5
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public FlowControllerDescription parseFlowControllerDescription(XMLInputSource aInput, ParsingOptions aOptions) throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof FlowControllerDescription) {
    return (FlowControllerDescription) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
            FlowControllerDescription.class.getName(), object.getClass().getName() });
  }
}
 
Example 6
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public ResourceManagerConfiguration parseResourceManagerConfiguration(XMLInputSource aInput,
        ParsingOptions aOptions) throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof ResourceManagerConfiguration) {
    return (ResourceManagerConfiguration) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        ResourceManagerConfiguration.class.getName(), object.getClass().getName() });
  }
}
 
Example 7
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public FsIndexCollection parseFsIndexCollection(XMLInputSource aInput, ParsingOptions aOptions)
        throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof FsIndexCollection) {
    return (FsIndexCollection) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        FsIndexCollection.class.getName(), object.getClass().getName() });
  }
}
 
Example 8
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public TypeSystemDescription parseTypeSystemDescription(XMLInputSource aInput,
        ParsingOptions aOptions) throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof TypeSystemDescription) {
    return (TypeSystemDescription) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        TypeSystemDescription.class.getName(), object.getClass().getName() });
  }
}
 
Example 9
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public TypePriorities parseTypePriorities(XMLInputSource aInput, ParsingOptions aOptions)
        throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof TypePriorities) {
    return (TypePriorities) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        TypePriorities.class.getName(), object.getClass().getName() });
  }
}
 
Example 10
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public CollectionReaderDescription parseCollectionReaderDescription(XMLInputSource aInput,
        ParsingOptions aOptions) throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof CollectionReaderDescription) {
    return (CollectionReaderDescription) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        CollectionReaderDescription.class.getName(), object.getClass().getName() });
  }
}
 
Example 11
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
   * @deprecated
   */
  @Deprecated
public CasInitializerDescription parseCasInitializerDescription(XMLInputSource aInput,
          ParsingOptions aOptions) throws InvalidXMLException {
    // attempt to locate resource specifier schema
    XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

    if (object instanceof CasInitializerDescription) {
      return (CasInitializerDescription) object;
    } else {
      throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
          CasInitializerDescription.class.getName(), object.getClass().getName() });
    }
  }
 
Example 12
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * @see org.apache.uima.util.XMLParser#parseCasConsumerDescription(org.apache.uima.util.XMLInputSource)
 */
public CasConsumerDescription parseCasConsumerDescription(XMLInputSource aInput,
        ParsingOptions aOptions) throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof CasConsumerDescription) {
    return (CasConsumerDescription) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        CasConsumerDescription.class.getName(), object.getClass().getName() });
  }
}
 
Example 13
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * @see org.apache.uima.util.XMLParser#parseResultSpecification(org.apache.uima.util.XMLInputSource)
 */
public ResultSpecification parseResultSpecification(XMLInputSource aInput, ParsingOptions aOptions)
        throws InvalidXMLException {
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, null, aOptions);

  if (object instanceof ResultSpecification) {
    return (ResultSpecification) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        ResultSpecification.class.getName(), object.getClass().getName() });
  }
}
 
Example 14
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Parses a AnalysisEngineDescription from an XML input stream. XML schema validation will be done
 * against the {@link #RESOURCE_SPECIFIER_SCHEMA_NAME} if it can be found in the classpath.
 * 
 * @param aInput
 *          the input source from which to read the XML document
 * 
 * @return a <code>AnalysisEngineDescription</code> object constructed from the XML document
 * 
 * @throws InvalidXMLException
 *           if the input XML is not valid or does not specify a valid AnalysisEngineDescription
 */
public AnalysisEngineDescription parseAnalysisEngineDescription(XMLInputSource aInput,
        ParsingOptions aOptions) throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof AnalysisEngineDescription) {
    return (AnalysisEngineDescription) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        AnalysisEngineDescription.class.getName(), object.getClass().getName() });
  }
}
 
Example 15
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Parses a URISpecifier from an XML input stream. XML schema validation will be done against the
 * {@link #RESOURCE_SPECIFIER_SCHEMA_NAME} if it can be found in the classpath.
 * 
 * @param aInput
 *          the input source from which to read the XML document
 * 
 * @return a <code>URISpecifier</code> object constructed from the XML document
 * 
 * @throws InvalidXMLException
 *           if the input XML is not valid or does not specify a valid URISpecifier
 */
public URISpecifier parseURISpecifier(XMLInputSource aInput, ParsingOptions aOptions)
        throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof URISpecifier) {
    return (URISpecifier) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        URISpecifier.class.getName(), object.getClass().getName() });
  }
}
 
Example 16
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Parses a ResourceMetaData object from an XML input stream. XML schema validation will be done
 * against the {@link #RESOURCE_SPECIFIER_SCHEMA_NAME} if it can be found in the classpath.
 * 
 * @param aInput
 *          the input source from which to read the XML document
 * 
 * @return a <code>ResourceMetaData</code> object constructed from the XML document
 * 
 * @throws InvalidXMLException
 *           if the input XML is not valid or does not specify a valid ResourceSpecifier
 */
public ResourceMetaData parseResourceMetaData(XMLInputSource aInput, ParsingOptions aOptions)
        throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof ResourceMetaData) {
    return (ResourceMetaData) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        ResourceMetaData.class.getName(), object.getClass().getName() });
  }
}
 
Example 17
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 3 votes vote down vote up
/**
 * Parses a ResourceSpecifier from an XML input stream. XML schema validation will be done against
 * the {@link #RESOURCE_SPECIFIER_SCHEMA_NAME} if it can be found in the classpath.
 * 
 * @param aInput
 *          the input source from which to read the XML document
 * 
 * @return a <code>ResourceSpecifier</code> object constructed from the XML document
 * 
 * @throws InvalidXMLException
 *           if the input XML is not valid or does not specify a valid ResourceSpecifier
 */
public ResourceSpecifier parseResourceSpecifier(XMLInputSource aInput, ParsingOptions aOptions)
        throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);
  if (object instanceof ResourceSpecifier) {
    return (ResourceSpecifier) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        ResourceSpecifier.class.getName(), object.getClass().getName() });
  }
}
 
Example 18
Source File: XMLParser_impl.java    From uima-uimaj with Apache License 2.0 3 votes vote down vote up
/**
 * Parses a TaeDescription from an XML input stream. XML schema validation will be done against
 * the {@link #RESOURCE_SPECIFIER_SCHEMA_NAME} if it can be found in the classpath.
 * 
 * @param aInput
 *          the input source from which to read the XML document
 * 
 * @return a <code>TaeDescription</code> object constructed from the XML document
 * 
 * @throws InvalidXMLException
 *           if the input XML is not valid or does not specify a valid TaeDescription
 * 
 * @deprecated since v2.0
 */
@Deprecated
public TaeDescription parseTaeDescription(XMLInputSource aInput, ParsingOptions aOptions)
        throws InvalidXMLException {
  // attempt to locate resource specifier schema
  XMLizable object = parse(aInput, RESOURCE_SPECIFIER_NAMESPACE, SCHEMA_URL, aOptions);

  if (object instanceof TaeDescription) {
    return (TaeDescription) object;
  } else {
    throw new InvalidXMLException(InvalidXMLException.INVALID_CLASS, new Object[] {
        TaeDescription.class.getName(), object.getClass().getName() });
  }
}