![JAR search and dependency download from the Maven repository](/logo.png)
org.oddjob.arooa.standard.ValueConfigurationCreator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arooa Show documentation
Show all versions of arooa Show documentation
A Rip Off Of Ant - A drag and drop component framework.
package org.oddjob.arooa.standard;
import org.oddjob.arooa.ArooaException;
import org.oddjob.arooa.ElementMappings;
import org.oddjob.arooa.handlers.ElementAction;
import org.oddjob.arooa.life.InstantiationContext;
import org.oddjob.arooa.parsing.ArooaContext;
import org.oddjob.arooa.parsing.ArooaElement;
import org.oddjob.arooa.reflect.ArooaClass;
public class ValueConfigurationCreator
implements ElementAction{
public InstanceConfiguration onElement(ArooaElement element, ArooaContext context) {
ElementMappings mappings = context.getSession(
).getArooaDescriptor().getElementMappings();
if (mappings == null) {
throw new NullPointerException(
"No Value Element Mappings in Descriptor.");
}
ArooaClass classIdentifier = mappings.mappingFor(element,
new InstantiationContext(context));
if (classIdentifier == null) {
throw new ArooaException("No definition for [" +
element + "]");
}
Object object = classIdentifier.newInstance();
InstanceConfiguration instance = new ObjectConfiguration(
classIdentifier, object, element.getAttributes());
return instance;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy