/*
/////////////////////////////////////////////////////////
Internal methods, input access:
/////////////////////////////////////////////////////////
766788
private void loadMoreScoped(WstxInputSource currScope,
                                String entityName, Location loc)
        throws XMLStreamException
    {
        boolean check = (mInput == currScope);
        loadMore(getErrorMsg());
        // Did we get out of the scope?
        if (check && (mInput != currScope)) {
            _reportWFCViolation("Unterminated entity value for entity '"
                                +entityName+"' (definition started at "
                                +loc+")");
        }
    }
807702
public void setInputDataConfig(java.util.Collection<Channel> inputDataConfig) {
        if (inputDataConfig == null) {
            this.inputDataConfig = null;
            return;
        }

        this.inputDataConfig = new java.util.ArrayList<Channel>(inputDataConfig);
    }
93221
private void initAddKeyInput() {

        //the input field for the key
        m_addKeyInput = new TextField();
        m_addKeyInput.setWidth("100%");
        m_addKeyInput.setInputPrompt(m_messages.key(Messages.GUI_INPUT_PROMPT_ADD_KEY_0));
        final ShortcutListener shortCutListener = new ShortcutListener("Add key via ENTER", KeyCode.ENTER, null) {

            private static final long serialVersionUID = 1L;

            @Override
            public void handleAction(Object sender, Object target) {

                handleAddKey();

            }

        };
        m_addKeyInput.addFocusListener(new FocusListener() {

            private static final long serialVersionUID = 1L;

            public void focus(FocusEvent event) {

                m_addKeyInput.addShortcutListener(shortCutListener);

            }
        });
        m_addKeyInput.addBlurListener(new BlurListener() {

            private static final long serialVersionUID = 1L;

            public void blur(BlurEvent event) {

                m_addKeyInput.removeShortcutListener(shortCutListener);

            }
        });

    }
361914
@SuppressWarnings("resource")
    @Override
    public void parse(InputSource input) throws SAXException
    {
        mScanner = null;
        String sysIdStr = input.getSystemId();
        ReaderConfig cfg = mConfig;
        URL srcUrl = null;

        // Let's figure out input, first, before sending start-doc event
        InputStream is = null;
        Reader r = input.getCharacterStream();
        if (r == null) {
            is = input.getByteStream();
            if (is == null) {
                if (sysIdStr == null) {
                    throw new SAXException("Invalid InputSource passed: neither character or byte stream passed, nor system id specified");
                }
                try {
                    srcUrl = URLUtil.urlFromSystemId(sysIdStr);
                    is = URLUtil.inputStreamFromURL(srcUrl);
                } catch (IOException ioe) {
                    SAXException saxe = new SAXException(ioe);
                    ExceptionUtil.setInitCause(saxe, ioe);
                    throw saxe;
                }
            }
        }

        if (mContentHandler != null) {
            mContentHandler.setDocumentLocator(this);
            mContentHandler.startDocument();
        }

        /* Note: since we are reusing the same config instance, need to
         * make sure state is not carried forward. Thus:
         */
        cfg.resetState();

        try {
            String inputEnc = input.getEncoding();
            String publicId = input.getPublicId();

            // Got an InputStream and encoding? Can create a Reader:
            if (r == null && (inputEnc != null && inputEnc.length() > 0)) {
                r = DefaultInputResolver.constructOptimizedReader(cfg, is, false, inputEnc);
            }
            InputBootstrapper bs;
            SystemId systemId = SystemId.construct(sysIdStr, srcUrl);
            if (r != null) {
                bs = ReaderBootstrapper.getInstance(publicId, systemId, r, inputEnc);
                // false -> not for event reader; false -> no auto-closing
                mScanner = (BasicStreamReader) mStaxFactory.createSR(cfg, systemId, bs, false, false);
            } else {
                bs = StreamBootstrapper.getInstance(publicId, systemId, is);
                mScanner = (BasicStreamReader) mStaxFactory.createSR(cfg, systemId, bs, false, false);
            }

            // Need to get xml declaration stuff out now:
            {
                String enc2 = mScanner.getEncoding();
                if (enc2 == null) {
                    enc2 = mScanner.getCharacterEncodingScheme();
                }
                mEncoding = enc2;
            }
            mXmlVersion = mScanner.getVersion();
            mStandalone = mScanner.standaloneSet();
            mAttrCollector = mScanner.getAttributeCollector();
            mElemStack = mScanner.getInputElementStack();
            fireEvents();
        } catch (IOException io) {
            throwSaxException(io);
        } catch (XMLStreamException strex) {
            throwSaxException(strex);
        } finally {
            if (mContentHandler != null) {
                mContentHandler.endDocument();
            }
            // Could try holding onto the buffers, too... but
            // maybe it's better to allow them to be reclaimed, if
            // needed by GC
            if (mScanner != null) {
                BasicStreamReader sr = mScanner;
                mScanner = null;
                try {
                    sr.close();
                } catch (XMLStreamException sex) { }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException ioe) { }
            }
            if (is != null) {
                try {
                    is.close();
                } catch (IOException ioe) { }
            }
        }
    }
410973
public StrTokenizer reset(final String input) {
        reset();
        if (input != null) {
            this.chars = input.toCharArray();
        } else {
            this.chars = null;
        }
        return this;
    }
42171
public void putAllValues(Map<String, V> input) {
        for (Map.Entry<String, V> entry : input.entrySet()) {
            put(entry.getKey(), entry.getValue());
        }
    }
1082262
public final void mINSERT() throws RecognitionException {
		try {
			int _type = INSERT;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// druidG.g:581:11: ( ( 'INSERT' | 'insert' ) )
			// druidG.g:581:12: ( 'INSERT' | 'insert' )
			{
			// druidG.g:581:12: ( 'INSERT' | 'insert' )
			int alt1=2;
			int LA1_0 = input.LA(1);
			if ( (LA1_0=='I') ) {
				alt1=1;
			}
			else if ( (LA1_0=='i') ) {
				alt1=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 1, 0, input);
				throw nvae;
			}

			switch (alt1) {
				case 1 :
					// druidG.g:581:13: 'INSERT'
					{
					match("INSERT"); 

					}
					break;
				case 2 :
					// druidG.g:581:22: 'insert'
					{
					match("insert"); 

					}
					break;

			}

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
1035270
public void setInput(final String input) {
        if (input == null) {
            throw (new IllegalArgumentException(
                    "You must provide a COBOL source folder or file"));
        }
        File file = new File(input);
        if (file.exists()) {
            if (file.isDirectory() && file.list().length == 0) {
                throw new IllegalArgumentException("Folder " + input
                        + " is empty");
            }
        } else {
            throw new IllegalArgumentException("Input file or folder " + input
                    + " not found");
        }
        _input = file;
    }
1135465
static function input($input_type, $name, $value=null, $settings=[])
    {
        $settings = static::formatSettings($settings);
        is_array($value) && $value = current($value);
        $str = '';
        $pre_input_type = $input_type;
        switch ($input_type) {
            case 'checkbox':
            case 'radio':
                $settings['class'] = isset($settings['class']) ? $settings['class'] : 'ace ace-switch ace-switch-5';
                $str .= '<label>' . PHP_EOL ;
                break;
            case 'text':
            case 'password':
                $settings['id'] = isset($settings['id']) ? static::formatId($settings['id']) : static::formatId($name);
                $settings['class'] = isset($settings['class']) ? 'form-control ' . $settings['class'] : 'form-control';
                break;
            case 'datetime':
            case 'date':
                $input_type = 'text';
                $value = $pre_input_type == 'datetime' ? DataHelper::fromUnixtime($value) : DataHelper::toDate($value);
                $settings['id'] = isset($settings['id']) ? static::formatId($settings['id']) : static::formatId($name);
                $settings['class']  = isset($settings['class']) ? $settings['class'] . ' form-control date-picker' : ' form-control date-picker';
                break;
            default:
                $settings['class'] = isset($settings['class']) ? $settings['class'] : '';
                break;
        }
        
        $str .= '<input type="' . $input_type . '" name="' . $name . '"';
        
        if ($input_type == 'checkbox' || $input_type == 'radio') {
            // 处理 value, checked
            $o_form_value = !is_null($value) || $value !== '' ? $value : '1';
            $value   = $value ? : '1';
            if (isset($settings['checked'])) {
                if (is_array($settings['checked'])) {
                    $_checked = in_array($value, $settings['checked']) ? true : false;
                } elseif (in_array($settings['checked'], ['', 1,0,true,false])) {
                    $_checked = $settings['checked'];
                } else {
                    $_checked = $value == $settings['checked'] ? true : false;
                }
                $str .= $_checked ? ' checked="checked"' : '';
            } elseif (is_numeric($o_form_value) || is_bool($o_form_value)) {
                if (intval($o_form_value) == 1) {
                    $str .= ' checked="checked"';
                }
            }
        }
        
        $str .= ' value="' . $value . '"';
        
        foreach($settings as $k => $v) {
            if (in_array($k, array('class', 'onchange', 'id', 'readonly', 'style', 'placeholder'))) {
                $str .= " $k=\"$v\"";
            } elseif($k == 'checked' && ($input_type !== 'checkbox' && $input_type !== 'radio')) {
                $str .= " $k=\"$v\"";
            }
        }
        $str .= '> ';
        
        if ($input_type == 'checkbox' || $input_type == 'radio') {
            $title = isset($settings['title']) ? $settings['title'] : '';
            $str .= ' <span class="lbl"> '.$title.' </span> ' . PHP_EOL;
            $str .= '</label>' . PHP_EOL ;
        }
        
        /**
         * 处理日期输入控件，依赖于 jquery.js, jquery-ui.datetime.js, datetimepicker.js, datetimepicker.css
         * <script src='{$rootUrl}/static/jquery/jquery-1.10.2.min.js'></script>
         * <link type="text/css" rel="stylesheet" href="{$rootUrl}/static/datetimepicker-2.5.3/jquery.datetimepicker.css"/>
         * <script src="{$rootUrl}/static/datetimepicker-2.5.3/jquery.datetimepicker.full.min.js"></script>
         */
        if ($pre_input_type == 'datetime' || $pre_input_type == 'date') {
            $innerJs = "";
            $dformat = $pre_input_type == 'datetime' ? 'Y-m-d H:i:s' : 'Y-m-d';
            if (!static::$isLoaded['datetime']) {
                $web_url = Config::getRootUrl();
                $innerJs .= <<<EOF
                    <link type="text/css" rel="stylesheet" href="${web_url}/static/datetimepicker-2.5.3/jquery.datetimepicker.css"/>
EOF;
                static::$isLoaded['datetime'] = true;
            }
            $innerJs .= <<<EOF
                <script>
                    require(['jquery.datetime'], function() {
                        $("#${settings['id']}").datetimepicker({
                    		format:	"{$dformat}",
                    	});
                    });
                </script>
EOF;
            $dt_str = '<div class="input-group input-group-sm">' . PHP_EOL;
            $dt_str .= $str . PHP_EOL;
            $dt_str .= '<span class="input-group-addon">' . PHP_EOL;
            $dt_str .= '    <i class="fa fa-clock-o bigger-110"></i>' . PHP_EOL;
            $dt_str .= '</span>' . PHP_EOL;
            $dt_str .= '</div>' . PHP_EOL;
            $dt_str .= $innerJs;
            	
            $str = & $dt_str;
        }
         
        return $str;
    }
809513
function Input(manager, callback) {
    var self = this;
    this.manager = manager;
    this.callback = callback;
    this.element = manager.element;
    this.target = manager.options.inputTarget;

    // smaller wrapper around the handler, for the scope and the enabled state of the manager,
    // so when disabled the input events are completely bypassed.
    this.domHandler = function(ev) {
        if (boolOrFn(manager.options.enable, [manager])) {
            self.handler(ev);
        }
    };

    this.init();

}
1036494
function getInputValue() {
      var input = _this.getInput();

      if (!input) {
        return null;
      }

      switch (innerParams.input) {
        case 'checkbox':
          return input.checked ? 1 : 0;

        case 'radio':
          return input.checked ? input.value : null;

        case 'file':
          return input.files.length ? input.files[0] : null;

        default:
          return innerParams.inputAutoTrim ? input.value.trim() : input.value;
      }
    }
347933
@Override
	public void read(DataInputView in) throws IOException {
		final boolean isNotNull = in.readBoolean();
		if (isNotNull) {
			final String scheme = StringUtils.readNullableString(in);
			final String userInfo = StringUtils.readNullableString(in);
			final String host = StringUtils.readNullableString(in);
			final int port = in.readInt();
			final String path = StringUtils.readNullableString(in);
			final String query = StringUtils.readNullableString(in);
			final String fragment = StringUtils.readNullableString(in);

			try {
				uri = new URI(scheme, userInfo, host, port, path, query, fragment);
			} catch (URISyntaxException e) {
				throw new IOException("Error reconstructing URI", e);
			}
		}
	}
1329355
@Override
    public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
    {
        checkParameterBounds(parameterIndex);
        throw SQLError.noSupport();
    }
1266393
function _inputChar(char) {
    if(_charIsPrintable(char.charCodeAt(0))
      &&utils.isSelectable(document.activeElement)) {
      // add the char
      // FIXME: put at caretPosition/replace selected content
      document.activeElement.value += char;
      // fire an input event
      utils.dispatch(document.activeElement, {type: 'input'});
    }
  }
1281509
public final String input() throws RecognitionException {
        String value = null;


        String unquoted_string3 =null;

        String quoted_string4 =null;


        try {
            // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:87:3: ( unquoted_string | quoted_string )
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0==STRING) ) {
                alt6=1;
            }
            else if ( ((LA6_0 >= STRING_WITH_QUOTE && LA6_0 <= STRING_WITH_QUOTE_DOUBLE)) ) {
                alt6=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 6, 0, input);

                throw nvae;

            }
            switch (alt6) {
                case 1 :
                    // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:87:5: unquoted_string
                    {
                    pushFollow(FOLLOW_unquoted_string_in_input238);
                    unquoted_string3=unquoted_string();

                    state._fsp--;


                     value = unquoted_string3; 

                    }
                    break;
                case 2 :
                    // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:88:5: quoted_string
                    {
                    pushFollow(FOLLOW_quoted_string_in_input246);
                    quoted_string4=quoted_string();

                    state._fsp--;


                     value = quoted_string4; 

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return value;
    }
737880
function() {
			// Input event is ignored if paste/drop event were fired before.
			if ( this.ignoreInputEvent ) {
				// Reset flag - ignore only once.
				this.ignoreInputEvent = false;
				return;
			}

			var lastInput = this.keyEventsStack.getLast();
			// Nothing in key events stack, but input event called. Interesting...
			// That's because on Android order of events is buggy and also keyCode is set to 0.
			if ( !lastInput ) {
				lastInput = this.keyEventsStack.push( 0 );
			}

			// Increment inputs counter for provided key code.
			this.keyEventsStack.increment( lastInput.keyCode );

			// Exceeded limit.
			if ( this.keyEventsStack.getTotalInputs() >= this.undoManager.strokesLimit ) {
				this.undoManager.type( lastInput.keyCode, true );
				this.keyEventsStack.resetInputs();
			}
		}
202299
@Override
    public boolean condition(Object input) {
        if (input instanceof String) {
            return !schema.getMetaData(columnIdx).isValid(new Text(input.toString()));
        } else if (input instanceof Double) {
            Double d = (Double) input;
            return !schema.getMetaData(columnIdx).isValid(new DoubleWritable(d));
        } else if (input instanceof Integer) {
            Integer i = (Integer) input;
            return !schema.getMetaData(columnIdx).isValid(new IntWritable(i));
        } else if (input instanceof Long) {
            Long l = (Long) input;
            return !schema.getMetaData(columnIdx).isValid(new LongWritable(l));
        } else if (input instanceof Boolean) {
            Boolean b = (Boolean) input;
            return !schema.getMetaData(columnIdx).isValid(new BooleanWritable(b));
        }

        else
            throw new IllegalStateException("Illegal type " + input.getClass().toString());
    }