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

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

There is a newer version: 2.2.5.1
Show newest version
/*
 * @(#)$Id: AnyNameClass.java,v 1.12 2003/09/11 19:00:18 kohsuke 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;

/**
 * a NameClass that matches any name.
 * 
 * @author Kohsuke KAWAGUCHI
 */
public final class AnyNameClass extends NameClass {
    
    /** AnyNameClass accpets any name, as its name suggests. */
    public boolean accepts( String namespaceURI, String localName ) {
        return true;
    }
    
    public Object visit( NameClassVisitor visitor ) { return visitor.onAnyName(this); }
    
    /**
     * Singleton instance.
     * 
     * @deprecated Use {@link NameClass#ALL} instead.
     */
    public static final NameClass theInstance = new AnyNameClass();
    
    protected AnyNameClass() {}
    
    public String toString()    { return "*:*"; }
    
    // serialization support
    private static final long serialVersionUID = 1;    
    private Object readResolve() { return theInstance; }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy