001    // Copyright 2010 Waterken Inc. under the terms of the MIT X license
002    // found at http://www.opensource.org/licenses/mit-license.html
003    package org.waterken.syntax;
004    
005    import java.io.Serializable;
006    
007    import org.joe_e.Struct;
008    
009    /**
010     * A {@linkplain Exporter#apply exported} value.
011     */
012    public class Export extends Struct implements Serializable {
013        static private final long serialVersionUID = 1L;
014    
015        /**
016         * object to transmit instead of the exported reference
017         */
018        public final Object replacement;
019        
020        /**
021         * URI for the exported reference
022         */
023        public final String href;
024        
025        /**
026         * Constructs a replacement instance.
027         * @param replacement   {@link #replacement}
028         */
029        public
030        Export(final Object replacement) {
031            this.replacement = replacement;
032            this.href = null;
033        }
034        
035        /**
036         * Constructs an exported link.
037         * @param href  {@link #href}
038         */
039        public
040        Export(final String href) {
041            this.replacement = null;
042            this.href = href;
043        }
044    }