📄 owlconfig.java
字号:
// The MIT License
//
// Copyright (c) 2004 Evren Sirin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
/*
* Created on Jan 15, 2004
*/
package org.mindswap.owl;
import java.util.Hashtable;
/**
* @author Evren Sirin
*/
public class OWLConfig {
/**
* Default language is used to determine which literal will be chosen by the
* getProperty(prop) function when there are multiple triples for the given
* property. An empty string means the literals with no language identifier
* will be chosen. A null value means the first found literal will be returned
* without looking at the language identifier. Note that even when a default
* language is chosen getProperty(prop, lang) can be used to get literal value
* for a certain identifier.
*
* All the language identifiers in the list will be tried in the order given.
* Original value for the list is
* DEFAULT_LANGS = {"en", "", "en", null};
* The ordering here works as follows:
* 1) Try the default language (which is English at the beginning but can be
* changed any time with setDefaultLanguage() function
* 2) Try to find literal with no language identifier
* 3) Try English literal
* 4) Try literal with any language identifier
*
* See http://www.w3.org/TR/REC-xml#sec-lang-tag for language identifier specs
*/
public static String[] DEFAULT_LANGS = {"en", "", "en", null};
/**
* Sets the default language that will be tried first when a literal property
* value is searched. Note that this function only sets the first language
* but there can be multiple languages defined as DEFAULT_LANGS.
*
* @param lang
*/
public static void setDefaultLanguage(String lang) {
DEFAULT_LANGS[0] = lang;
}
/**
* Sets all the languages that will be tried when a literal property values is
* searched. All the languages in the list wil lbe tried in the order given
*
* @param langs
*/
public static void setDefaultLanguages(String[] langs) {
DEFAULT_LANGS = langs;
}
public static Hashtable WRAPPERS = new Hashtable();
public static void addWrapper(Class view, OWLResourceWrapper wrapper) {
WRAPPERS.put(view ,wrapper);
}
public static OWLResourceWrapper getWrapper(Class view) {
return (OWLResourceWrapper) WRAPPERS.get(view);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -