HtmlAttr.java revision 3792:d516975e8110
155714Skris/*
255714Skris * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
355714Skris * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
455714Skris *
555714Skris * This code is free software; you can redistribute it and/or modify it
655714Skris * under the terms of the GNU General Public License version 2 only, as
755714Skris * published by the Free Software Foundation.  Oracle designates this
855714Skris * particular file as subject to the "Classpath" exception as provided
955714Skris * by Oracle in the LICENSE file that accompanied this code.
1055714Skris *
1155714Skris * This code is distributed in the hope that it will be useful, but WITHOUT
1255714Skris * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1355714Skris * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1455714Skris * version 2 for more details (a copy is included in the LICENSE file that
1555714Skris * accompanied this code).
1655714Skris *
1755714Skris * You should have received a copy of the GNU General Public License version
1855714Skris * 2 along with this work; if not, write to the Free Software Foundation,
1955714Skris * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2055714Skris *
2155714Skris * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2255714Skris * or visit www.oracle.com if you need additional information or have any
2355714Skris * questions.
2455714Skris */
2555714Skris
2655714Skrispackage jdk.javadoc.internal.doclets.formats.html.markup;
2755714Skris
2855714Skrisimport jdk.javadoc.internal.doclets.toolkit.util.Utils;
2955714Skris
3055714Skris/**
3155714Skris * Enum representing HTML tag attributes.
3255714Skris *
3355714Skris *  <p><b>This is NOT part of any supported API.
3455714Skris *  If you write code that depends on this, you do so at your own risk.
3555714Skris *  This code and its internal interfaces are subject to change or
3655714Skris *  deletion without notice.</b>
3755714Skris *
3855714Skris * @author Bhavesh Patel
3955714Skris */
4055714Skrispublic enum HtmlAttr {
4155714Skris    ALT,
4255714Skris    CLASS,
4355714Skris    CLEAR,
4455714Skris    COLS,
4555714Skris    CONTENT,
4655714Skris    DISABLED,
4755714Skris    HREF,
4855714Skris    HTTP_EQUIV("http-equiv"),
4955714Skris    ID,
5055714Skris    LANG,
5155714Skris    NAME,
5255714Skris    ONCLICK,
5355714Skris    ONLOAD,
5455714Skris    REL,
5555714Skris    ROLE,
5655714Skris    ROWS,
5755714Skris    SCOPE,
5855714Skris    SCROLLING,
5955714Skris    SRC,
6055714Skris    SUMMARY,
6155714Skris    TARGET,
6255714Skris    TITLE,
6355714Skris    TYPE,
6455714Skris    VALUE,
6559191Skris    WIDTH;
6655714Skris
6755714Skris    private final String value;
6855714Skris
6955714Skris    public enum Role {
7055714Skris
7155714Skris        BANNER,
7255714Skris        CONTENTINFO,
7355714Skris        MAIN,
7455714Skris        NAVIGATION,
7555714Skris        REGION;
7655714Skris
7755714Skris        private final String role;
7855714Skris
7955714Skris        Role() {
8055714Skris            role = Utils.toLowerCase(name());
8155714Skris        }
8255714Skris
8355714Skris        public String toString() {
8459191Skris            return role;
8555714Skris        }
8659191Skris    }
8759191Skris
8859191Skris    HtmlAttr() {
8959191Skris        this.value = Utils.toLowerCase(name());
9059191Skris    }
9159191Skris
9259191Skris    HtmlAttr(String name) {
9359191Skris        this.value = name;
9459191Skris    }
9559191Skris
9659191Skris    public String toString() {
9755714Skris        return value;
9855714Skris    }
9955714Skris}
10055714Skris