Package org.codehaus.preon.binding

Examples of org.codehaus.preon.binding.Binding


    public Reference<Resolver> selectAttribute(String name)
            throws BindingException {
        if ("outer".equals(name)) {
            return new OuterReference(outer, this);
        } else {
            Binding binding = bindingsByName.get(name);

            if (binding == null) {
                throw new BindingException(
                        "Failed to create binding for bound data called "
                                + name);
View Full Code Here


            if ("outer".equals(name)) {
                return outer;
            } else {

                if (bindingsByName.containsKey(name)) {
                    Binding binding = bindingsByName.get(name);

                    if (context == null) {
                        StringBuilderDocument document = new StringBuilderDocument();
                        // TODO:
//                        binding.describe(new ParaContentsDocument(document));
                        throw new BindingException("Failed to resolve "
                                + document.toString()
                                + " due to incomplete context.");
                    }

                    try {
                        return binding.get(context);
                    } catch (IllegalArgumentException e) {
                        throw new BindingException("Failed to bind to "
                                + binding.getName(), e);
                    } catch (IllegalAccessException e) {
                        throw new BindingException("Forbidded to access "
                                + binding.getName(), e);
                    }
                } else {
                    throw new BindingException("Failed to resolve " + name
                            + " on " + context.getClass());
                }
View Full Code Here

            if (!Modifier.isStatic(field.getModifiers())
                    && !field.isSynthetic()) {
                Codec<?> codec = codecFactory.create(field, field.getType(),
                        context);
                if (codec != null) {
                    Binding binding = bindingFactory.create(field, field,
                            codec, context, reference);
                    context.add(field.getName(), binding);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.codehaus.preon.binding.Binding

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.