Examples of AssemblerException


Examples of com.hp.hpl.jena.assembler.exceptions.AssemblerException

        // Location or dataset reference.
        String locationDir = getStringValue(root, pLocation) ;
        Resource dataset = getResourceValue(root, pDataset) ;
       
        if ( locationDir != null && dataset != null )
            throw new AssemblerException(root, "Both location and dataset given: exactly one required") ;
       
        if ( locationDir == null && dataset == null )
            throw new AssemblerException(root, "Must give location or refer to a dataset description") ;
       
        String graphName = null ;
        if ( root.hasProperty(pGraphName1) )
            graphName = getAsStringValue(root, pGraphName1) ;
        if ( root.hasProperty(pGraphName2) )
View Full Code Here

Examples of com.hp.hpl.jena.assembler.exceptions.AssemblerException

        return make(root) ;
    }

    static Dataset make(Resource root) {
        if ( !exactlyOneProperty(root, pLocation) )
            throw new AssemblerException(root, "No location given") ;

        String dir = getStringValue(root, pLocation) ;
        Location loc = new Location(dir) ;
        DatasetGraph dsg = TDBFactory.createDatasetGraph(loc) ;
View Full Code Here

Examples of com.hp.hpl.jena.assembler.exceptions.AssemblerException

    }

    static Dataset make(Resource root)
    {
        if ( ! exactlyOneProperty(root, pLocation) )
            throw new AssemblerException(root, "No location given") ;

        String dir = getStringValue(root, pLocation) ;
        Location loc = new Location(dir) ;
        DatasetGraph dsg = TDBFactory.createDatasetGraph(loc) ;
       
View Full Code Here

Examples of com.hp.hpl.jena.assembler.exceptions.AssemblerException

        // Location or dataset reference.
        String locationDir = getStringValue(root, pLocation) ;
        Resource dataset = getResourceValue(root, pDataset) ;
       
        if ( locationDir != null && dataset != null )
            throw new AssemblerException(root, "Both location and dataset given: exactly one required") ;
       
        if ( locationDir == null && dataset == null )
            throw new AssemblerException(root, "Must give location or refer to a dataset description") ;
       
        String graphName = null ;
        if ( root.hasProperty(pGraphName1) )
            graphName = getAsStringValue(root, pGraphName1) ;
        if ( root.hasProperty(pGraphName2) )
View Full Code Here

Examples of com.hp.hpl.jena.assembler.exceptions.AssemblerException

  public Model open(Assembler a, Resource root, Mode mode) {

    Resource rootModel = getUniqueResource( root, BASE_MODEL );
    if (rootModel == null)
    {
      throw new AssemblerException( root, String.format( NO_X_PROVIDED, BASE_MODEL, root ));
    }
    Model baseModel = a.openModel(rootModel, mode);
 
    Literal modelName = getUniqueLiteral( root, JA.modelName );
    if (modelName == null)
    {
      throw new AssemblerException( root, String.format( NO_X_PROVIDED, JA.modelName, root ));
    }
   
    Literal factoryName = getUniqueLiteral( root, EVALUATOR_FACTORY );
    if (factoryName == null)
    {
      throw new AssemblerException( root, String.format( NO_X_PROVIDED, EVALUATOR_FACTORY, root ));
    }
    SecurityEvaluator securityEvaluator = null;
    try
    {
      Class<?> factoryClass = Class.forName( factoryName.getString() );
      Method method = factoryClass.getMethod("getInstance" );
      if ( ! SecurityEvaluator.class.isAssignableFrom(method.getReturnType()))
      {
        throw new AssemblerException( root, String.format( "%s (found at %s for %s) getInstance() must return an instance of SecurityEvaluator", factoryName, EVALUATOR_FACTORY, root ));
      }
      if ( ! Modifier.isStatic( method.getModifiers()))
      {
        throw new AssemblerException( root, String.format( "%s (found at %s for %s) getInstance() must be a static method", factoryName, EVALUATOR_FACTORY, root ));     
      }
      securityEvaluator = (SecurityEvaluator) method.invoke( null );
    }
    catch (SecurityException e)
    {
      throw new AssemblerException( root, String.format( ERROR_FINDING_FACTORY, factoryName, e.getMessage() ), e);     
    }
    catch (IllegalArgumentException e)
    {
      throw new AssemblerException( root, String.format( ERROR_FINDING_FACTORY, factoryName, e.getMessage() ), e);     
    }
    catch (ClassNotFoundException e)
    {
      throw new AssemblerException( root, String.format( "Class %s (found at %s for %s) could not be loaded", factoryName, EVALUATOR_FACTORY, root ));
    }
    catch (NoSuchMethodException e)
    {
      throw new AssemblerException( root, String.format( "%s (found at %s for %s) must implement a static getInstance() that returns an instance of SecurityEvaluator", factoryName, EVALUATOR_FACTORY, root ));
    }
    catch (IllegalAccessException e)
    {
      throw new AssemblerException( root, String.format( ERROR_FINDING_FACTORY, factoryName, e.getMessage() ), e);     
    }
    catch (InvocationTargetException e)
    {
      throw new AssemblerException( root, String.format( ERROR_FINDING_FACTORY, factoryName, e.getMessage() ), e);     
    }

    return Factory.getInstance(securityEvaluator, modelName.asLiteral().getString(), baseModel);
     
  }
View Full Code Here

Examples of com.hp.hpl.jena.assembler.exceptions.AssemblerException

//            return NodeTableFactory.create(IndexBuilder.get(), new Location(location)) ;
//       
//        String nodeIndex = getAsStringValue(root, pNodeIndex) ;
//        String nodeData = getAsStringValue(root, pNodeData) ;
//       
        throw new AssemblerException(root, "Split location index/data file not yet implemented") ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.assembler.exceptions.AssemblerException

        // Location or dataset reference.
        String locationDir = getStringValue(root, pLocation) ;
        Resource dataset = getResourceValue(root, pDataset) ;
       
        if ( locationDir != null && dataset != null )
            throw new AssemblerException(root, "Both location and dataset given: exactly one required") ;
       
        if ( locationDir == null && dataset == null )
            throw new AssemblerException(root, "Must give location or refer to a dataset description") ;
       
        String graphName = null ;
        if ( root.hasProperty(pGraphName1) )
            graphName = getAsStringValue(root, pGraphName1) ;
        if ( root.hasProperty(pGraphName2) )
View Full Code Here

Examples of com.hp.hpl.jena.assembler.exceptions.AssemblerException

    }

    static Dataset make(Resource root)
    {
        if ( ! exactlyOneProperty(root, pLocation) )
            throw new AssemblerException(root, "No location given") ;

        String dir = getStringValue(root, pLocation) ;
        Location loc = new Location(dir) ;
        // ARQ 2.9.0 does not have Dataset.getContext
        DatasetGraph dsg = TDBFactory.createDatasetGraph(loc) ;
View Full Code Here

Examples of com.hp.hpl.jena.assembler.exceptions.AssemblerException

    public Object open(Assembler a, Resource root, Mode mode)
    {
        LARQ.init();

        if ( ! GraphUtils.exactlyOneProperty(root, LARQAssemblerVocab.pIndex) )
            throw new AssemblerException(root, "Required: exactly one index property" ) ;

        try
        {
            String indexPath = GraphUtils.getAsStringValue(root, LARQAssemblerVocab.pIndex) ;
            return make(null, indexPath) ;
View Full Code Here

Examples of com.hp.hpl.jena.assembler.exceptions.AssemblerException

    }

    static Dataset make(Resource root)
    {
        if ( ! exactlyOneProperty(root, pLocation) )
            throw new AssemblerException(root, "No location given") ;

        String dir = getStringValue(root, pLocation) ;
        Location loc = new Location(dir) ;
        // ARQ 2.9.0 does not have Dataset.getContext
        DatasetGraph dsg = TDBFactory.createDatasetGraph(loc) ;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.