Package org.criticalfailure.torchlight.core.domain.builder

Examples of org.criticalfailure.torchlight.core.domain.builder.ObjectBuilderException


        }

        // if the dialog didn't place a template into the instance, or the caller didn't set an object template, then
        // abort
        if(objectTemplate == null) {
            throw new ObjectBuilderException(
                    "No object template has been assigned to this builder or instance; cannot continue with build!");
        }

        // iterate over the template's properties, and create data for each
        for(ObjectProperty op : instance.getObjectTemplate().getProperties()) {
View Full Code Here


            // TODO
        }

        // validation: check object instance
        if(objectInstance == null) {
            throw new ObjectBuilderException(
                    "No object instance has been assigned to this builder; cannot continue with build!");
        }

        // validation: check object property
        if(objectProperty == null) {
            throw new ObjectBuilderException(
                    "No object property has been assigned to this builder; cannot continue with build!");
        }

        // check if property is a meta-property (i.e., building data for this property actually causes data for other
        // properties to be created/built)
        // TODO

        // check if object data is provided (for building non-meta property data; datum is ignored for meta-properties)
        // TODO
        if(datum == null) {
            throw new ObjectBuilderException("No object datum provided for this builder; cannot continue with build!");
        }

        // check if property name contains a placeholder
        Pattern p = Pattern.compile(".*(\\{\\w+\\}).*");
        Matcher m = p.matcher(objectProperty.getName());
        if(m.matches()) {
            logger.debug("object property name contains a placeholder: " + m.group());

            if(StringUtils.stripToNull(placeholderValue) == null) {
                throw new ObjectBuilderException(
                        "Property name contains a placeholder, but no placeholder value was provided!");
            }

            m.replaceAll(placeholderValue);
        }
View Full Code Here

TOP

Related Classes of org.criticalfailure.torchlight.core.domain.builder.ObjectBuilderException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.