1 /* Copyright 2004 The Apache Software Foundation 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 package org.apache.xmlbeans; 17 18 import javax.xml.namespace.QName; 19 20 /** 21 * The BindingConfig class is used during compilation to control the generation of java source files. 22 * The default BindingConfig does nothing, but sub-classes should provide more interesting behavior. 23 * 24 * @see XmlBeans#compileXmlBeans(String, SchemaTypeSystem, XmlObject[], BindingConfig, SchemaTypeLoader, Filer, XmlOptions) XmlBeans.compileXmlBeans() 25 */ 26 public class BindingConfig 27 { 28 private static final InterfaceExtension[] EMPTY_INTERFACE_EXT_ARRAY = new InterfaceExtension[0]; 29 private static final PrePostExtension[] EMPTY_PREPOST_EXT_ARRAY = new PrePostExtension[0]; 30 private static final UserType[] EMPTY_USER_TYPE_ARRY = new UserType[0]; 31 32 public static final int QNAME_TYPE = 1; 33 public static final int QNAME_DOCUMENT_TYPE = 2; 34 public static final int QNAME_ACCESSOR_ELEMENT = 3; 35 public static final int QNAME_ACCESSOR_ATTRIBUTE = 4; 36 37 /** 38 * Get the package name for a namespace or null. 39 */ 40 public String lookupPackageForNamespace(String uri) { return null; } 41 42 /** 43 * Get the prefix applied to each java name for a namespace or null. 44 */ 45 public String lookupPrefixForNamespace(String uri) { return null; } 46 47 /** 48 * Get the suffix applied to each java name for a namespace or null. 49 */ 50 public String lookupSuffixForNamespace(String uri) { return null; } 51 52 /** 53 * Get the java name for a QName or null. 54 * @deprecated replaced with {@link #lookupJavanameForQName(QName, int)} 55 */ 56 public String lookupJavanameForQName(QName qname) { return null; } 57 58 /** 59 * Get the java name for a QName of a specific component kind, or null. 60 * @see #QNAME_TYPE 61 * @see #QNAME_TYPE_DOCUMENT 62 * @see #QNAME_METHOD_ELEMENT 63 * @see #QNAME_METHOD_ATTRIBUTE 64 */ 65 public String lookupJavanameForQName(QName qname, int kind) { return null; } 66 67 /** 68 * Returns all configured InterfaceExtensions or an empty array. 69 */ 70 public InterfaceExtension[] getInterfaceExtensions() { return EMPTY_INTERFACE_EXT_ARRAY; } 71 72 /** 73 * Returns all InterfaceExtensions defined for the fully qualified java 74 * type generated from schema compilation or an empty array. 75 */ 76 public InterfaceExtension[] getInterfaceExtensions(String fullJavaName) { return EMPTY_INTERFACE_EXT_ARRAY; } 77 78 /** 79 * Returns all configued PrePostExtensions or an empty array. 80 */ 81 public PrePostExtension[] getPrePostExtensions() { return EMPTY_PREPOST_EXT_ARRAY; } 82 83 /** 84 * Returns the PrePostExtension defined for the fully qualified java 85 * type generated from schema compilation or null. 86 */ 87 public PrePostExtension getPrePostExtension(String fullJavaName) { return null; } 88 89 /** 90 * Returns all defined user types. 91 */ 92 public UserType[] getUserTypes() { return EMPTY_USER_TYPE_ARRY; } 93 94 /** 95 * Returns a user defined Java type for a given QName. 96 */ 97 public UserType lookupUserTypeForQName(QName qname) { return null; } 98 99 }