src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocument.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -30,11 +30,10 @@
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.Set;
/**
* A WSDL document.
*
* @author WS Development Team
@@ -108,34 +107,36 @@
public void accept(WSDLDocumentVisitor visitor) throws Exception {
_definitions.accept(visitor);
}
+ @Override
public void validate(EntityReferenceValidator validator) {
GloballyValidatingAction action =
new GloballyValidatingAction(this, validator);
withAllSubEntitiesDo(action);
if (action.getException() != null) {
throw action.getException();
}
}
+ @Override
protected Entity getRoot() {
return _definitions;
}
private Definitions _definitions;
- private class GloballyValidatingAction
- implements EntityAction, EntityReferenceAction {
+ private static class GloballyValidatingAction implements EntityAction, EntityReferenceAction {
public GloballyValidatingAction(
AbstractDocument document,
EntityReferenceValidator validator) {
_document = document;
_validator = validator;
}
+ @Override
public void perform(Entity entity) {
try {
entity.validateThis();
entity.withAllEntityReferencesDo(this);
entity.withAllSubEntitiesDo(this);
@@ -144,13 +145,14 @@
_exception = e;
}
}
}
+ @Override
public void perform(Kind kind, QName name) {
try {
- GloballyKnown entity = _document.find(kind, name);
+ _document.find(kind, name);
} catch (NoSuchEntityException e) {
// failed to resolve, check with the validator
if (_exception == null) {
if (_validator == null
|| !_validator.isValid(kind, name)) {