Package org.jostraca.util

Examples of org.jostraca.util.ValueSet


                                   ? iRegExpIsDirective.match( pBlock.getContent() )
                                   : EMPTY ) ) );
    }
    catch( RegExpException ree ) {
      throw new TemplateElementProcessorException( TemplateElementProcessorException.CODE_regexp_failed,
                                                   new ValueSet( ValueCode.REGEXP, iRegExpIsDirective ), ree );
    }
  }
View Full Code Here


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

    // MatchDirective
    try {
      if( ! Standard.EMPTY.equals( iDirectiveMarker ) ) {
        iRegExpText_MatchDirective = pPropertySet.get( Property.jostraca_regexp_MatchDirective );
        iRegExpMatchDirective      = RegExp.make( iRegExpText_MatchDirective, new RegExp.ModeSet( RegExp.Mode.DotMatchesNewline ) );
        iPerformMatchDirective     = true;
      }     
    }
    catch( Exception e ) {
      throw new TemplateElementProcessorException
        ( TemplateElementProcessorException.CODE_bad_regexp, e.getMessage(),
          new ValueSet( ValueCode.REGEXP, iRegExpText_MatchDirective ) );
    }

  }
View Full Code Here

      }     
    }
    catch( Exception e ) {
      throw new TemplateElementProcessorException
        ( TemplateElementProcessorException.CODE_bad_regexp, e.getMessage(),
          new ValueSet( ValueCode.REGEXP, iRegExpText_MatchSectionName,
                        ValueCode.NAME,   Property.jostraca_regexp_MatchSectionName ) );
    }

    try {
      if( Standard.EMPTY.equals( iDeclarationMarker ) ) {
        iPerformMatchDeclaration = false;
      }
      else {
        iRegExpText_MatchDeclaration = pPropertySet.get( Property.jostraca_regexp_MatchDeclaration );
        iRegExpMatchDeclaration      = RegExp.make( iRegExpText_MatchDeclaration, new RegExp.ModeSet( RegExp.Mode.DotMatchesNewline ) );
        iPerformMatchDeclaration     = true;
      }
    }
    catch( Exception e ) {
      throw new TemplateElementProcessorException
        ( TemplateElementProcessorException.CODE_bad_regexp, e.getMessage(),
          new ValueSet( ValueCode.REGEXP, iRegExpText_MatchDeclaration,
                        ValueCode.NAME,   Property.jostraca_regexp_MatchDeclaration ) );
    }
  }
View Full Code Here

      return match;
    }
    catch( Exception e ) {
      throw new TemplateElementProcessorException
        ( TemplateElementProcessorException.CODE_unexpected_regexp_mismatch, e.getMessage(),
          new ValueSet( ValueCode.REGEXP,  iRegExpText_MatchSectionName,
                        ValueCode.NAME,    Property.jostraca_regexp_MatchSectionName,
                        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_MatchDeclaration,
                        ValueCode.NAME,    Property.jostraca_regexp_MatchDeclaration,
                        ValueCode.CONTENT, pContent ) );
    }
  }
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  includeBlockContent = markRegExp.match( includeFileContent );

        // very important - prevent data loss
        if( Standard.EMPTY.equals( includeBlockContent ) ) {
          throw new TemplateException( TemplateException.CODE_includeblock_find,
                                       new ValueSet( ValueCode.FILE, includeBlockFile, ValueCode.VALUE, includeBlockMark ) );
        }

        int    startOfIncludeBlock = source.indexOf( includeBlockText );
        if( 0 > startOfIncludeBlock ) { // paranoia ;)
          continue;
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

      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

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.