Package org.jostraca.util

Examples of org.jostraca.util.ValueSet


      iUnitList.add( bu );
    }
    catch( Exception e ) {
      throw new TemplateElementProcessorException
        ( TemplateElementProcessorException.CODE_unexpected_regexp_mismatch, e.getMessage(),
          new ValueSet( ValueCode.REGEXP, iRegExpText_MatchExpression,
                        ValueCode.CONTENT, content ) );
    }

    iTemplateActionHandler.setLastElementType( ELEMENT_TYPE_expression );
   
View Full Code Here


      }
    }
    catch( Exception e ) {
      throw new TemplateElementProcessorException
        ( TemplateElementProcessorException.CODE_bad_regexp, e.getMessage(),
          new ValueSet( ValueCode.REGEXP, iRegExpText_IsExpression ) );
    }

    try {
      if( ! Standard.EMPTY.equals( iExpressionMarker ) ) {
        iRegExpText_MatchExpression = pPropertySet.get( Property.jostraca_regexp_MatchExpression );
        iRegExpMatchExpression      = RegExp.make( iRegExpText_MatchExpression, new RegExp.ModeSet( RegExp.Mode.DotMatchesNewline ) );
        iPerformMatchExpression     = true;
      }
    }
    catch( Exception e ) {
      throw new TemplateElementProcessorException
        ( TemplateElementProcessorException.CODE_bad_regexp, e.getMessage(),
          new ValueSet( ValueCode.REGEXP, iRegExpText_MatchExpression ) );
    }
  }
View Full Code Here

      return match;
    }
    catch( Exception e ) {
      throw new TemplateElementProcessorException
        ( TemplateElementProcessorException.CODE_unexpected_regexp_mismatch, e.getMessage(),
          new ValueSet( ValueCode.REGEXP, iRegExpText_IsExpression,
                        ValueCode.CONTENT, pContent ) );
    }
  }
View Full Code Here

      return match;
    }
    catch( Exception e ) {
      throw new TemplateElementProcessorException
        ( TemplateElementProcessorException.CODE_unexpected_regexp_mismatch, e.getMessage(),
          new ValueSet( ValueCode.REGEXP, iRegExpText_MatchExpression,
                        ValueCode.CONTENT, pContent ) );
    }
  }
View Full Code Here

  public static void testCodeValueSet() {
    String n01 = "n01";
    String v01 = "v01";
    TemplateElementProcessorException tepe
      = new TemplateElementProcessorException( TemplateElementProcessorException.CODE_system,
                                               new ValueSet( n01, v01 ) );
   
    assertTrue( TemplateElementProcessorException.CODE_system == tepe.getCode() );
    assertTrue( v01.equals( ((ValueSet)tepe.getContext()).get( n01 ) ) );
  }
View Full Code Here

    }
    catch( TemplateException te ) {
      throw te;
    }
    catch( IOException ioe ) {
      throw new TemplateException( TemplateException.CODE_load_file, new ValueSet( ValueCode.FILE, pTemplatePath ) );
    }
    catch( Exception e ) {
      throw new TemplateException( MN+e );
    }
  }
View Full Code Here

      String templateSource = pSource;

      RegExpMatch[] allconfs = iConfRegExp.matchAll( templateSource );
      int           numConfs = allconfs.length;
      if( 0 == numConfs && pConfRequired ) {
        throw new TemplateException( TemplateException.CODE_no_conf, new ValueSet( ValueCode.TEMPLATE, iPath ) );
      }
      else {
        PropertySet ps        = new PropertySet();
        boolean     foundConf = false;
        RegExpMatch conf      = null;
        String      props     = null;
        PropertySet propSet   = null;
        for( int confI = 0; confI < numConfs; confI++ ) {
          conf    = allconfs[ confI ];
          props   = conf.matchFirstSub();
          propSet = new PropertySet();
          propSet.parse( props );
          ps.overrideWith( propSet );
          foundConf = true;
        }
       
        iOrderedPSM.get( Service.CONF_template ).overrideWith( ps );

        if( foundConf ) {
          // remove conf sections from template
          // WARNING: relying on default replace to be empty string here
          templateSource = iConfRegExp.replaceAll( templateSource );
        }
        else if( pConfRequired ) {
          throw new TemplateException( TemplateException.CODE_no_conf, new ValueSet( ValueCode.TEMPLATE, iPath ) );
        }
      }

      return templateSource;

    }
    catch( TemplateException te ) {
      throw te;
    }
    catch( PropertySetException pse ) {
      throw new TemplateException( TemplateException.CODE_parse_conf, new ValueSet( ValueCode.TEMPLATE, iPath ), pse );
    }
    catch( Exception e ) {
      throw new TemplateException( TemplateException.CODE_no_conf, new ValueSet( ValueCode.TEMPLATE, iPath ), e );
    }
  }
View Full Code Here

    try {
      classList = pPropertySet.get( Property.lang_CodeWriterTransforms );
      iCodeWriterTextualTransformManager.loadClasses( classList );
    }
    catch( Exception e ) {
      throw ProcessException.CODE_post_proc_tran( new ValueSet( ValueCode.CLASSLIST, classList ), e );
    }
  }
View Full Code Here

        // REVIEW: this is deprecated
        pTemplateActionHandler.append( content );
      }
      else {
        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

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.