Fetching properties using strings?

It’s possible to fetch Blocktypes, Blockstates, Traits, using strings serialized from configs, but is it possible to fetch Properties or block data manipulators?

I’m currently trying to write a BlockType/BlockState filter, and being able to read in rules from a config file.

You could parse the Strings or use Java reflection.

For Properties, afaik it is not possible, so you’d have to serialize them manually or open an issue for SpongeAPI to have Properties implement DataSerializable.
For Data Manipulators, create a DataView of them by calling .toContainer() and pass that to the ConfigurateTranslator, which can translate between DataViews and ConfigurationNodes.

Serialization Example:

public void writeToConfig(HealthData data, ConfigurationNode target) {
    DataView container = data.toContainer();
    ConfigurateTranslator.instance().translateContainerToData(target, container);
}

Deserialization Example:

public Optional<HealthData> readFromConfig(ConfigurationNode config) {
    DataView container = ConfigurateTranslator.instance().translateFrom(config);
    DataManipulatorBuilder<HealthData,ImmutableHealthData> builder = game.getRegistry()
            .getManipulatorRegistry().getBuilder(HealthData.class).get();
    return builder.build(container);
}

Caveat: Above code compiles, yet remains untested