Examples of ValueSet


Examples of org.apache.pig.builtin.VALUESET

        m.put("open", "apache");
        m.put("1", "hadoop");
        m.put("source", "apache");
        Tuple input = TupleFactory.getInstance().newTuple(m);

        VALUESET valueSet = new VALUESET();
        DataBag result = valueSet.exec(input);

        //Value set should only contain 2 elements
        assertEquals(result.size(), 2);
        Iterator<Tuple> i = result.iterator();
        List resultList = new ArrayList<String>();
View Full Code Here

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

Examples of org.jostraca.util.ValueSet

      }     
    }
    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

Examples of org.jostraca.util.ValueSet

      }     
    }
    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

Examples of org.jostraca.util.ValueSet

      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

Examples of org.jostraca.util.ValueSet

      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

Examples of org.jostraca.util.ValueSet

    }
    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

Examples of org.jostraca.util.ValueSet

        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

Examples of org.jostraca.util.ValueSet

      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

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
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.