Package org.jostraca.util

Examples of org.jostraca.util.ValueSet


    // REVIEW: handle this better
    String   refinedDirectiveName  = pDirectiveName;
    String[] directiveNameElements = DirectiveParser.getNameElements( refinedDirectiveName );
    if( null == directiveNameElements || 0 == directiveNameElements.length ) {
      throw new DirectiveException( DirectiveException.CODE_unknown, new ValueSet( ValueCode.NAME, pDirectiveName ) );
    }
    String directiveName = directiveNameElements[0];

    if( ! iDirectiveTable.containsKey( directiveName ) ) {
      throw new DirectiveException( DirectiveException.CODE_unknown, new ValueSet( ValueCode.NAME, pDirectiveName ) );
    }

    performDirective( directiveName,
                      refinedDirectiveName,
                      pArguments,
View Full Code Here


      }
      else {
       
        // REVIEW: better to have the full directive text or line numbers
        throw new DirectiveException( DirectiveException.CODE_bad_args,
                                      new ValueSet( ValueCode.DIRECTIVE, pDirectiveName,
                                                    ValueCode.ARGUMENTS, pArguments ) );
      }
    }
  }
View Full Code Here

      iRegExpMatchArguments      = RegExp.make( iRegExpText_MatchArguments, RegExp.ModeSet.DotMatchesNewline );
    }
    catch( Exception e ) {
      throw new DirectiveException
        ( DirectiveException.CODE_bad_regexp, e.getMessage(),
          new ValueSet( ValueCode.REGEXP, iRegExpText_MatchArguments ) );
    }

  }
View Full Code Here

      return match;
    }
    catch( RegExpException e ) {
      throw new DirectiveException
        ( DirectiveException.CODE_regexp_mismatch, e.getMessage(),
          new ValueSet( ValueCode.REGEXP, iRegExpText_MatchArguments,
                        ValueCode.CONTENT, pContent ) );
    }
  }
View Full Code Here

  }


  public void testInsertions() {
   
    ValueSet vs      = new ValueSet( ValueCode.VALUE, "v", ValueCode.FILE, "f" );
    String   inserts = vs.insertValues( "value: $<"+ValueCode.VALUE+"> file: $<"+ValueCode.FILE+">" );

    assertEquals( "v", vs.get( ValueCode.VALUE ) );
    assertEquals( "f", vs.get( ValueCode.FILE ) );
    assertEquals( "value: v file: f", inserts );
  }
View Full Code Here


  /* Public Methods << */

  public void testValueSet01() {
    ValueSet vs = new ValueSet( "pName01", "rValue01" );
    assertTrue( vs.get( "pName01" ).equals( "rValue01" ) );
  }
View Full Code Here

    ValueSet vs = new ValueSet( "pName01", "rValue01" );
    assertTrue( vs.get( "pName01" ).equals( "rValue01" ) );
  }

  public void testValueSet02() {
    ValueSet vs = new ValueSet( "pName01", "rValue01"
                                ,"pName02", "rValue02"
                                );
    assertTrue( vs.get( "pName01" ).equals( "rValue01" ) );
    assertTrue( vs.get( "pName02" ).equals( "rValue02" ) );
  }
View Full Code Here

    assertTrue( vs.get( "pName01" ).equals( "rValue01" ) );
    assertTrue( vs.get( "pName02" ).equals( "rValue02" ) );
  }

  public void testValueSet03() {
    ValueSet vs = new ValueSet( "pName01", "rValue01"
                                ,"pName02", "rValue02"
                                ,"pName03", "rValue03"
                                );
    assertTrue( vs.get( "pName01" ).equals( "rValue01" ) );
    assertTrue( vs.get( "pName02" ).equals( "rValue02" ) );
    assertTrue( vs.get( "pName03" ).equals( "rValue03" ) );
  }
View Full Code Here

    assertTrue( vs.get( "pName02" ).equals( "rValue02" ) );
    assertTrue( vs.get( "pName03" ).equals( "rValue03" ) );
  }

  public void testValueSet04() {
    ValueSet vs = new ValueSet( "pName01", "rValue01"
                                ,"pName02", "rValue02"
                                ,"pName03", "rValue03"
                                ,"pName04", "rValue04"
                                );
    assertTrue( vs.get( "pName01" ).equals( "rValue01" ) );
    assertTrue( vs.get( "pName02" ).equals( "rValue02" ) );
    assertTrue( vs.get( "pName03" ).equals( "rValue03" ) );
    assertTrue( vs.get( "pName04" ).equals( "rValue04" ) );
  }
View Full Code Here

    assertTrue( vs.get( "pName03" ).equals( "rValue03" ) );
    assertTrue( vs.get( "pName04" ).equals( "rValue04" ) );
  }

  public void testValueSet05() {
    ValueSet vs = new ValueSet( "pName01", "rValue01"
                                ,"pName02", "rValue02"
                                ,"pName03", "rValue03"
                                ,"pName04", "rValue04"
                                ,"pName05", "rValue05"
                                );
    assertTrue( vs.get( "pName01" ).equals( "rValue01" ) );
    assertTrue( vs.get( "pName02" ).equals( "rValue02" ) );
    assertTrue( vs.get( "pName03" ).equals( "rValue03" ) );
    assertTrue( vs.get( "pName04" ).equals( "rValue04" ) );
    assertTrue( vs.get( "pName05" ).equals( "rValue05" ) );
  }
View Full Code Here

TOP

Related Classes of org.jostraca.util.ValueSet

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.