All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.tools.xjc.addon.xew.config.ClassConfiguration Maven / Gradle / Ivy

Go to download

This JAXB plugin utilizes the power of @XmlElementWrapper annotation. Originally xjc trends to create wrapper classes which are the containers for collections. This plugin goes through all properties to find ones which can be represented in the model in more optimal way.

There is a newer version: 2.1
Show newest version
package com.sun.tools.xjc.addon.xew.config;

import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * Per-class or per-field configuration.
 */
public class ClassConfiguration extends CommonConfiguration {

	public ClassConfiguration(CommonConfiguration configuration) {
		super(configuration);
	}

	/**
	 * Returns the value of {@code annotate} option. By default returns {@code true}.
	 */
	public boolean isAnnotatable() {
		return ObjectUtils.defaultIfNull((Boolean) configurationValues.get(ConfigurationOption.ANNOTATE), Boolean.TRUE)
		            .booleanValue();
	}

	public void setAnnotatable(boolean annotate) {
		configurationValues.put(ConfigurationOption.ANNOTATE, Boolean.valueOf(annotate));
	}

	@Override
	protected ToStringBuilder appendProperties(ToStringBuilder builder) {
		super.appendProperties(builder);
		builder.append("excluded", isAnnotatable());

		return builder;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy