1 /* 2 * Copyright 2001-2008 The Apache Software Foundation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 package org.uddi.api_v2; 18 19 import javax.xml.bind.annotation.XmlEnum; 20 import javax.xml.bind.annotation.XmlEnumValue; 21 import javax.xml.bind.annotation.XmlType; 22 23 24 /** 25 * <p>Java class for URLType. 26 * 27 * <p>The following schema fragment specifies the expected content contained within this class. 28 * <p> 29 * <pre> 30 * <simpleType name="URLType"> 31 * <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN"> 32 * <enumeration value="mailto"/> 33 * <enumeration value="http"/> 34 * <enumeration value="https"/> 35 * <enumeration value="ftp"/> 36 * <enumeration value="fax"/> 37 * <enumeration value="phone"/> 38 * <enumeration value="other"/> 39 * </restriction> 40 * </simpleType> 41 * </pre> 42 * 43 */ 44 @XmlType(name = "URLType") 45 @XmlEnum 46 public enum URLType { 47 48 @XmlEnumValue("mailto") 49 MAILTO("mailto"), 50 @XmlEnumValue("http") 51 HTTP("http"), 52 @XmlEnumValue("https") 53 HTTPS("https"), 54 @XmlEnumValue("ftp") 55 FTP("ftp"), 56 @XmlEnumValue("fax") 57 FAX("fax"), 58 @XmlEnumValue("phone") 59 PHONE("phone"), 60 @XmlEnumValue("other") 61 OTHER("other"); 62 private final String value; 63 64 URLType(String v) { 65 value = v; 66 } 67 68 public String value() { 69 return value; 70 } 71 72 public static URLType fromValue(String v) { 73 for (URLType c: URLType.values()) { 74 if (c.value.equals(v)) { 75 return c; 76 } 77 } 78 throw new IllegalArgumentException(v); 79 } 80 81 }