All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.msv.grammar.NamespaceNameClass Maven / Gradle / Ivy

There is a newer version: 2.2.5.1
Show newest version
/*
 * @(#)$Id: NamespaceNameClass.java,v 1.10 2003/06/09 20:37:17 kk122374 Exp $
 *
 * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the proprietary information of Sun Microsystems, Inc.  
 * Use is subject to license terms.
 * 
 */
package com.sun.msv.grammar;

/**
 * NameClass that matchs any names in a particular namespace.
 * 
 * @author Kohsuke KAWAGUCHI
 */
public class NamespaceNameClass extends NameClass {
    public final String    namespaceURI;
    
    /**
     * accepts a name if its namespace URI matches to the namespaceURI field.
     */
    public boolean accepts( String namespaceURI, String localName ) {
        if( NAMESPACE_WILDCARD==namespaceURI )    return true;
        return this.namespaceURI.equals(namespaceURI);
    }
    
    public Object visit( NameClassVisitor visitor ) { return visitor.onNsName(this); }
    
    public NamespaceNameClass( String namespaceURI ) {
        this.namespaceURI    = namespaceURI;
    }
    
    public String toString() {
        return namespaceURI+":*";
    }
    
    // serialization support
    private static final long serialVersionUID = 1;    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy