001/*
002 * (c) Copyright 2010 University of Bristol
003 * All rights reserved.
004 * [See end of file]
005 */
006package net.rootdev.javardfa.uri;
007
008import java.util.Arrays;
009import java.util.Collections;
010import java.util.List;
011import java.util.Set;
012import javax.xml.namespace.QName;
013import javax.xml.stream.events.Attribute;
014import javax.xml.stream.events.StartElement;
015import net.rootdev.javardfa.EvalContext;
016import net.rootdev.javardfa.Setting;
017
018/**
019 *
020 * @author pldms
021 */
022public interface URIExtractor {
023    
024    // Represents a missing URI.
025    // We can distinguish between a missing attribute and missing URI
026    final static String NONE = "__NONE__";
027        
028    void setSettings(Set<Setting> settings);
029
030    String getURI(StartElement element, QName attrName, EvalContext context);
031        
032    List<String> getURIs(StartElement element, QName attrName, EvalContext context);
033    
034    String resolveURI(String uri, EvalContext context);
035}
036
037
038/*
039 * (c) Copyright 2010 University of Bristol
040 * All rights reserved.
041 *
042 * Redistribution and use in source and binary forms, with or without
043 * modification, are permitted provided that the following conditions
044 * are met:
045 * 1. Redistributions of source code must retain the above copyright
046 *    notice, this list of conditions and the following disclaimer.
047 * 2. Redistributions in binary form must reproduce the above copyright
048 *    notice, this list of conditions and the following disclaimer in the
049 *    documentation and/or other materials provided with the distribution.
050 * 3. The name of the author may not be used to endorse or promote products
051 *    derived from this software without specific prior written permission.
052 *
053 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
054 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
055 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
056 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
057 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
058 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
059 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
060 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
061 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
062 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
063 */