01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.axis2.databinding.types;
20:
21: /**
22: * Custom class for supporting XSD data type language language represents natural language
23: * identifiers as defined by [RFC 1766]. The value space of language is the set of all strings that
24: * are valid language identifiers as defined in the language identification section of [XML 1.0
25: * (Second Edition)]. The lexical space of language is the set of all strings that are valid
26: * language identifiers as defined in the language identification section of [XML 1.0 (Second
27: * Edition)]. The base type of language is token.
28: *
29: * @see <a href="http://www.w3.org/TR/xmlschema-2/#language">XML Schema 3.3.3</a>
30: */
31: public class Language extends Token {
32:
33: private static final long serialVersionUID = -4105320293090087959L;
34:
35: public Language() {
36: super ();
37: }
38:
39: /**
40: * ctor for Language
41: *
42: * @throws IllegalArgumentException will be thrown if validation fails
43: */
44: public Language(String stValue) throws IllegalArgumentException {
45: try {
46: setValue(stValue);
47: } catch (IllegalArgumentException e) {
48: // recast normalizedString exception as token exception
49: throw new IllegalArgumentException(
50: // Messages.getMessage("badLanguage00") +
51: "data=[" + stValue + "]");
52: }
53: }
54:
55: /**
56: * Validates the value against the xsd definition. Language-Tag = Primary-tag *( "-" Subtag )
57: * Primary-tag = 1*8ALPHA Subtag = 1*8ALPHA TODO
58: *
59: * @see <a href="http://www.ietf.org/rfc/rfc1766.txt">RFC1766</a>
60: */
61: public static boolean isValid(String stValue) {
62: return true;
63: }
64: }
|