Package org.apache.ivy.plugins.parser.xml

Examples of org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser$State


        }
   
    @Test public void testResourceURI()
        {
        Model m = ModelFactory.createDefaultModel();
        Resource r = new Parser( "noProperties" ).resourceIn( m );
        assertIsoModels( empty, m );
        assertEquals( ModelTestBase.resource( "noProperties" ), r );
        }
View Full Code Here


        }
   
    private Resource parseAsResource( String modelString )
        {
        Model m = ModelFactory.createDefaultModel();
        return new Parser( modelString ).resourceIn( m );
        }
View Full Code Here

    protected Model m( String s )
        { return modelWithStatements( s ); }

    protected Model parse( String s )
        { Model m = createModel( ReificationStyle.Standard );
        Model mDash = new Parser( s ).parseInto( m );
        assertSame( m, mDash );
        return m; }
View Full Code Here

    protected OntModel ontModel( String facts )
        {
        OntModel result =  ModelFactory.createOntologyModel();
        result.setNsPrefixes( PrefixMapping.Extended );
        setRequiredPrefixes( result );
        new Parser( facts ).parseInto( result );
        return result;
        }
View Full Code Here

    /**
        Eyeball test models are constructed using the extended parser.
    */
    protected Model modelAddFacts( Model result, String s )
        { return new Parser( s ).parseInto( result ); }
View Full Code Here

   *
   * @param toMatch
   * @return
   */
  public Iterator<Lookup> match(String toMatch) {
    State currentState = getInitialState();
    for (int i = 0; i < toMatch.length(); i++) {
      char currentChar = toMatch.charAt(i);
      currentState = currentState.next(currentChar);
      if (currentState == null) {
        break;
      }
      if (i==(toMatch.length()-1) && currentState.isFinal()) {  // we are at the last character
        return getLookups(currentState);
      }
    }
    return null;
  }
View Full Code Here

    kv2[0] = "KEY1of2";
    kv2[1] = "VALUE1of2";
    kv2[2] = "KEY2of2";
    kv2[3] = "VALUE2of2";
    gs.addLookup("as", info1, kv2);
    State init = gs.getInitialState();
    System.out.println("Initial State: "+init);
    State s1 = init.next('a');
    System.out.println("State after a: "+s1);
    System.out.println("isFinal: "+s1.isFinal());
    State s2 = s1.next('s');
    System.out.println("State after s: "+s2);
    System.out.println("isFinal: "+s2.isFinal());
    Iterator<Lookup> lookupIter = gs.getLookups(s2);
    System.out.println("Have lookups: "+lookupIter.hasNext());
    while(lookupIter.hasNext()) {
      Lookup l = lookupIter.next();
      System.out.println("Have a lookup"+l);
    }
    File someFile = new File("tmp.gazbin");
    try {
      gs.save(someFile);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      assertTrue("could not save trie", false);
      return;
    }
    GazStoreTrie3 gs2 = new GazStoreTrie3();
    try {
      gs2 = (GazStoreTrie3)gs2.load(someFile);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      assertTrue("could not load trie",false);
      return;
    }
    State init_2 = gs2.getInitialState();
    System.out.println("Initial State: "+init_2);
    State s1_2 = init_2.next('a');
    System.out.println("State after a: "+s1_2);
    System.out.println("isFinal: "+s1_2.isFinal());
    State s2_2 = s1_2.next('s');
    System.out.println("State after s: "+s2_2);
    System.out.println("isFinal: "+s2_2.isFinal());
    Iterator<Lookup> lookupIter_2 = gs2.getLookups(s2_2);
    System.out.println("Have lookups: "+lookupIter_2.hasNext());
    while(lookupIter_2.hasNext()) {
      Lookup l = lookupIter_2.next();
      System.out.println("Have a lookup"+l);
View Full Code Here

            File ivyFile = getIvyFileInCache(mrid);
            if (ivyFile.exists()) {
                // found in cache !
                try {
                    XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
                    ModuleDescriptor depMD = getMdFromCache(parser, options, ivyFile);
                    String resolverName = getSavedResolverName(depMD);
                    String artResolverName = getSavedArtResolverName(depMD);
                    DependencyResolver resolver = settings.getResolver(resolverName);
                    if (resolver == null) {
View Full Code Here

            File ivyFile = getIvyFileInCache(mrid);
            if (ivyFile.exists()) {
                // found in cache !
                try {
                    XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
                    ModuleDescriptor depMD = getMdFromCache(parser, options, ivyFile);
                    String resolverName = getSavedResolverName(depMD);
                    String artResolverName = getSavedArtResolverName(depMD);
                    DependencyResolver resolver = settings.getResolver(resolverName);
                    if (resolver == null) {
View Full Code Here

            File ivyFile = getIvyFileInCache(mrid);
            if (ivyFile.exists()) {
                // found in cache !
                try {
                    XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
                    ModuleDescriptor depMD = getMdFromCache(parser, options, ivyFile);
                    String resolverName = getSavedResolverName(depMD);
                    String artResolverName = getSavedArtResolverName(depMD);
                    DependencyResolver resolver = settings.getResolver(resolverName);
                    if (resolver == null) {
View Full Code Here

TOP

Related Classes of org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser$State

Copyright © 2018 www.massapicom. 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.