How to introduce new stream format in beanio - bean-io

Is beanio can support more stream format other than csv, fixedLength, delimited, json and xml? I have created a new module from beanio to add new format, But the beanio.properties used by StreamCompiler to map the format is resides in the beanio parent project, how will I add a new format to it?

I don't know if you can extend BeanIO this way, but it would be great if this works for you.
See Section 8 of the reference documentation on how to provide your custom beanio.properties file
8.0. Configuration
In some cases, BeanIO behavior can be controlled by setting optional property values. Properties can be set using System properties or a property file. BeanIO will load configuration setting in the following order of priority:
System properties.
A property file named beanio.properties. The file will be looked for first in the application's working directory, and then on the classpath.
The name and location of beanio.properties can be overridden using the System property org.beanio.configuration. In the following example, configuration settings will be loaded from the file named config/settings.properties, first relative to the application's working directory, and if not found, then from the root of the application's classpath.
java -Dorg.beanio.configuration=config/settings.properties example.Main
Please let us know if you can extend the formats supported this way.

Related

Custom XML formatter for Eclipse

Is it possible to define a new XML formatter in an Eclipse plugin? I have some XML files that must follow specific formatting rules, but see how way of plugging in to the formatter engine.
I can tie this formatter to files that are part of a project with a specific facet.
For context, I am maintaining the Sling IDE Tooling for Eclipse, and part of that application is concerned with synchronising local state with a remote JCR repository.
The synchronisation is based on XML files and folders stored on disk, following a well defined format - FileVault DocView. These XML files can contain metadata attached to files and folders, but also arbitrary hierarchical data.
The CLI tool that is used as an alternative to the IDE tooling and almost always in production follows strict set of rules regarding indentation, XML attribute ordering, etc and also rewrites files when pushing them to the repository.
I would like to follow this model and allow the users of the IDE to format the XML files following the exact same preset. The formatting model is actually quite simple, shown below:
format = new OutputFormat("xml", "UTF-8", true);
format.setIndent(4);
format.setLineWidth(0);
format.setBreakEachAttribute(true);
format.setSortAttributeNamesBy(AttributeNameComparator.INSTANCE);
The name comparator is also quite simple, sorting xmlns instructions first, then the namespaced properties, and then the other properties.
This was requested in https://bugs.eclipse.org/460055 , but not implemented.

Setting Cassandra password in reference.conf using Scala

How can an attribute be set programmatically in a reference.conf file?
For example, I am using something like this in Spring to set the attributes of the keystore:
System.setProperty("server.ssl.keyStore", "keystore.jks")
System.setProperty("server.ssl.keyStorePassword", "password123")
Same way, you can override configuration from the reference conf file using system properties, they have the highest precedence order as described here:
https://github.com/lightbend/config#standard-behavior
Please be aware you need to do it before the config is loaded by the class that uses it (via ConfigFactory.load()) and if any other class has already used ConfigFactory, then a call to ConfigFactory.invalidateCaches() will also be required, otherwise the cached value will be used.

Issue with spring cloud config property file order

I am using spring cloud config for loading properties file for my application. I have multiple environments. I notice that the property files are loaded in wrong order. This is what i see in my logs
Located property source: CompositePropertySource [name='configService', propertySources=[MapPropertySource [name='https://github.com/xyz/configrepo.git/gatekeeper-dev.properties'], MapPropertySource [name='https://github.com/xyz/configrepo.git/gatekeeper.properties']]]
It seems that the environment specific property file is loaded first and overridden by the default property file. Is there any way i can control the order in which they are loaded and processed ?
That is the expected order (for good reasons so I am surprised you found a use case where it wasn't convenient). You can't control it except by changing the names of the files and listing them in a comma separated form. For the sake of clarity: profile specific properties always override default ones. Possibly the logs have confused you.

Gatling 2 : How to change directory location of the scala classes

How can I change the location of the compiled scala files. Currently the files are stored in $GATLING_HOME/target/classes.
I thought the option "--simulations-binaries-folder" would do this.
"--simulations-binaries-folder" is used for forcing Gatling to search there for pre-compiled classes.
Check out gatling.conf file for the property named "gatling.core.directory.binaries". You can either override it directly in the file, or pass a System property with this name.

XML schema for Eclipse target definition files

Where can I find the XML schema and/or documentation for Eclipse target definition files (*.target)?
May be this schema might fit the target files created for an RCP platform.
Part of that schema file is visible in the Eclipse help page.
There is no schema or documentation defining the structure of a target definition file (.target). This is because the file structure is not intended to be API (it may change between release).
The structure has changed several times already. The code used to serialize/deserialize the file can be found in the following classes:
org.eclipse.pde.internal.core.target.TargetDefinitionPersistenceHelper
org.eclipse.pde.internal.core.target.TargetPersistence38Helper
org.eclipse.pde.internal.core.target.TargetPersistence36Helper
org.eclipse.pde.internal.core.target.TargetPersistence35Helper
org.eclipse.pde.internal.core.target.TargetPersistence34Helper