/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Parses DTD grammar along with binding information into BGM.
*
* @author
* <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
*/
{
/**
* Parses DTD grammar and a binding information into BGM.
*
* <p>
* This method is just a utility method that covers 80% of the use
* cases.
*
* @param bindingInfo
* binding information file, if any. Can be null.
*/
try {
// set up a ring
try {
try {
} catch (SAXParseException e) {
return null; // this error was already handled by GrammarReaderController
}
else return model;
} finally {
}
} catch (IOException e) {
return null;
} catch (SAXException e) {
return null;
} catch (AbortException e) {
// parsing was aborted but the error was already reported
return null;
}
}
throws AbortException {
}
/**
* binding information.
*
* <p>
* This is always non-null even if no binding information was specified.
* (In that case, a dummy object will be provided.)
*/
/**
* Element name to its content model definition.
*/
}
// bind them all.
// we need to know how elements are referencing each other before we do this,
// so this can be only done at the endDTD method
e.bind();
// if there was an error by now, just abort.
if (errorReceiver.hadError())
return;
// check XJC extensions and realize them
model.serializable=true;
// TODO: do we need to reimplement them?
// // performs annotation
// Annotator.annotate(model, this);
// FieldCollisionChecker.check( model, this );
}
/** Processes interface declarations. */
private void processInterfaceDeclarations() {
// first, create empty InterfaceItem declaration for all interfaces
intf._implements(c);
}
});
}
ci._implements(c);
}
});
}
// traverse the interface declarations again
// and populate its expression according to the members attribute.
// TODO: error location
member);
continue;
}
}
}
// TODO: check the cyclic interface definition
}
private static interface InterfaceAcceptor {
}
return bindInfo.getTargetPackage();
}
/**
* Creates constructor declarations as specified in the
* binding information.
*
* <p>
* Also checks that the binding file does not contain
* declarations for non-existent elements.
*/
private void processConstructorDeclarations() {
if(e==null) {
continue; // continue to process next declaration
}
// only element-class declaration has constructor definitions
continue;
}
}
public void attributeDecl(String elementName, String attributeName, String attributeType, String[] enumeration, short attributeUse, String defaultValue) throws SAXException {
);
}
throws SAXException {
// get the attribute-property declaration
// if no declaration is specified, just wrap it by
// a FieldItem and let the normalizer handle its content.
else
CPropertyInfo r = new CAttributePropertyInfo(
if(defaultValue!=null)
return r;
}
if(r==null) {
r = new Element(this,elementName);
}
return r;
}
assert modelGroups.isEmpty();
}
}
}
}
}
// TODO: for now, we just ignore all the content model specification
// and treat it as (A,B,C,....)
child.isReferenced = true;
}
/**
* Mutable {@link Locator} instance that points to
* the current source line.
* <p>
* Use {@link #copyLocator()} to get a immutable clone.
*/
}
/**
* Creates a snapshot of the current {@link #locator} values.
*/
return new LocatorImpl(locator);
}
//
//
// builtin datatype handling
//
//
/** Transducers for the built-in types. Read-only. */
static {
// list of datatypes which have built-in conversions.
// note that although xs:token and xs:normalizedString are not
// specified in the spec, they need to be here because they
// have different whitespace normalization semantics.
}
//
//
// error related utility methods
//
//
errorReceiver.error(e);
}
}
errorReceiver.warning(e);
}
}
}