org.apache.flink.shaded.jackson2.com.fasterxml.jackson.dataformat.yaml.YAMLParser Java Examples

The following examples show how to use org.apache.flink.shaded.jackson2.com.fasterxml.jackson.dataformat.yaml.YAMLParser. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConfigUtil.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public LowerCaseYamlMapper() {
	super(new YAMLFactory() {
		@Override
		protected YAMLParser _createParser(InputStream in, IOContext ctxt) throws IOException {
			final Reader r = _createReader(in, null, ctxt);
			// normalize all key to lower case keys
			return new YAMLParser(ctxt, _getBufferRecycler(), _parserFeatures, _yamlParserFeatures, _objectCodec, r) {
				@Override
				public String getCurrentName() throws IOException {
					if (_currToken == JsonToken.FIELD_NAME) {
						return _currentFieldName.toLowerCase();
					}
					return super.getCurrentName();
				}

				@Override
				public String getText() throws IOException {
					if (_currToken == JsonToken.FIELD_NAME) {
						return _currentFieldName.toLowerCase();
					}
					return super.getText();
				}
			};
		}
	});
}
 
Example #2
Source File: ConfigUtil.java    From flink with Apache License 2.0 6 votes vote down vote up
public LowerCaseYamlMapper() {
	super(new YAMLFactory() {
		@Override
		protected YAMLParser _createParser(InputStream in, IOContext ctxt) throws IOException {
			final Reader r = _createReader(in, null, ctxt);
			// normalize all key to lower case keys
			return new YAMLParser(ctxt, _getBufferRecycler(), _parserFeatures, _yamlParserFeatures, _objectCodec, r) {
				@Override
				public String getCurrentName() throws IOException {
					if (_currToken == JsonToken.FIELD_NAME) {
						return _currentFieldName.toLowerCase();
					}
					return super.getCurrentName();
				}

				@Override
				public String getText() throws IOException {
					if (_currToken == JsonToken.FIELD_NAME) {
						return _currentFieldName.toLowerCase();
					}
					return super.getText();
				}
			};
		}
	});
}
 
Example #3
Source File: ConfigUtil.java    From flink with Apache License 2.0 6 votes vote down vote up
public LowerCaseYamlMapper() {
	super(new YAMLFactory() {
		@Override
		protected YAMLParser _createParser(InputStream in, IOContext ctxt) throws IOException {
			final Reader r = _createReader(in, null, ctxt);
			// normalize all key to lower case keys
			return new YAMLParser(ctxt, _getBufferRecycler(), _parserFeatures, _yamlParserFeatures, _objectCodec, r) {
				@Override
				public String getCurrentName() throws IOException {
					if (_currToken == JsonToken.FIELD_NAME) {
						return _currentFieldName.toLowerCase();
					}
					return super.getCurrentName();
				}

				@Override
				public String getText() throws IOException {
					if (_currToken == JsonToken.FIELD_NAME) {
						return _currentFieldName.toLowerCase();
					}
					return super.getText();
				}
			};
		}
	});
}