/** * Check whether the specified interface is in the list of extended interfaces. * * @param interfac The interface that should be checked to see if it is in the list of exteneded interfaces. * @param extendedInterfaces An array of interfaces representing the list of extended interfaces. * @return true if the interface is in the list of extended interfaces, false otherwise. */ private boolean containsInterface(Interface interfac, Interface[] extendedInterfaces) { boolean foundInterface = false; int numExtInterfaces = extendedInterfaces.length; for(int i = 0; i < numExtInterfaces && !foundInterface; i++) { if(interfac.isEquivalentTo(extendedInterfaces[i])) foundInterface = true; else if(containsInterface(interfac, extendedInterfaces[i].getExtendedInterfaces())) foundInterface = true; } return foundInterface; }
/** * Check whether the specified interface is in the list of extended interfaces. * * @param interfac The interface that should be checked to see if it is in the list of exteneded interfaces. * @param extendedInterfaces An array of interfaces representing the list of extended interfaces. * @return true if the interface is in the list of extended interfaces, false otherwise. */ private boolean containsInterface(Interface interfac, Interface[] extendedInterfaces) { boolean foundInterface = false; int numExtInterfaces = extendedInterfaces.length; for(int i = 0; i < numExtInterfaces && !foundInterface; i++) { if(interfac.isEquivalentTo(extendedInterfaces[i])) foundInterface = true; else if(containsInterface(interfac, extendedInterfaces[i].getExtendedInterfaces())) foundInterface = true; } return foundInterface; }
/** * Helper method for testAssertionInterface0027. * Check whether the specified interface is in the array of provided * interfaces or in an array of interfaces one of the interfaces extends. * * @param interfac The interface to check for. * @param extendedInterfaces An array of extened interfaces to check for this interface. * @return The interface that is equal to or extends this interface, or null if the interface is not contained. */ private Interface containsInterface(Interface interfac, Interface[] extendedInterfaces) { int numExtInterfaces = extendedInterfaces.length; for(int i = 0; i < numExtInterfaces; i++) { if(interfac.isEquivalentTo(extendedInterfaces[i])) return extendedInterfaces[i]; else if(containsInterface(interfac, extendedInterfaces[i].getExtendedInterfaces()) != null) return extendedInterfaces[i]; } return null; }
/** * Helper method for testAssertionInterface0027. * Check whether the specified interface is in the array of provided * interfaces or in an array of interfaces one of the interfaces extends. * * @param interfac The interface to check for. * @param extendedInterfaces An array of extened interfaces to check for this interface. * @return The interface that is equal to or extends this interface, or null if the interface is not contained. */ private Interface containsInterface(Interface interfac, Interface[] extendedInterfaces) { int numExtInterfaces = extendedInterfaces.length; for(int i = 0; i < numExtInterfaces; i++) { if(interfac.isEquivalentTo(extendedInterfaces[i])) return extendedInterfaces[i]; else if(containsInterface(interfac, extendedInterfaces[i].getExtendedInterfaces()) != null) return extendedInterfaces[i]; } return null; }
private void getAllInterfaceFaults(Interface interfac, List allInterfaces, List allFaults) { //check for circular Interface references to avoid infinite loop if(containsComponent(interfac, allInterfaces)) { return; } else { allInterfaces.add(interfac); } //get the declared faults for the specified Interface InterfaceFault[] declaredFaults = interfac.getInterfaceFaults(); for(int i=0; i<declaredFaults.length; i++) { InterfaceFault fault = declaredFaults[i]; if(!containsComponent(fault, allFaults)) { allFaults.add(fault); } } //get the derived faults from each extended interface Interface[] extInts = interfac.getExtendedInterfaces(); for(int j=0; j<extInts.length; j++) { getAllInterfaceFaults(extInts[j], allInterfaces, allFaults); } }
private void getAllInterfaceOperations(Interface interfac, List allInterfaces, List allOpers) { //check for circular Interface references to avoid infinite loop if(containsComponent(interfac, allInterfaces)) { return; } else { allInterfaces.add(interfac); } //get the declared operations for the specified Interface InterfaceOperation[] declaredOpers = interfac.getInterfaceOperations(); for(int i=0; i<declaredOpers.length; i++) { InterfaceOperation oper = declaredOpers[i]; if(!containsComponent(oper, allOpers)) { allOpers.add(oper); } } //get the derived operations from each extended interface Interface[] extInts = interfac.getExtendedInterfaces(); for(int j=0; j<extInts.length; j++) { getAllInterfaceOperations(extInts[j], allInterfaces, allOpers); } }
private void getAllInterfaceOperations(Interface interfac, List allInterfaces, List allOpers) { //check for circular Interface references to avoid infinite loop if(containsComponent(interfac, allInterfaces)) { return; } else { allInterfaces.add(interfac); } //get the declared operations for the specified Interface InterfaceOperation[] declaredOpers = interfac.getInterfaceOperations(); for(int i=0; i<declaredOpers.length; i++) { InterfaceOperation oper = declaredOpers[i]; if(!containsComponent(oper, allOpers)) { allOpers.add(oper); } } //get the derived operations from each extended interface Interface[] extInts = interfac.getExtendedInterfaces(); for(int j=0; j<extInts.length; j++) { getAllInterfaceOperations(extInts[j], allInterfaces, allOpers); } }
private void getAllInterfaceFaults(Interface interfac, List allInterfaces, List allFaults) { //check for circular Interface references to avoid infinite loop if(containsComponent(interfac, allInterfaces)) { return; } else { allInterfaces.add(interfac); } //get the declared faults for the specified Interface InterfaceFault[] declaredFaults = interfac.getInterfaceFaults(); for(int i=0; i<declaredFaults.length; i++) { InterfaceFault fault = declaredFaults[i]; if(!containsComponent(fault, allFaults)) { allFaults.add(fault); } } //get the derived faults from each extended interface Interface[] extInts = interfac.getExtendedInterfaces(); for(int j=0; j<extInts.length; j++) { getAllInterfaceFaults(extInts[j], allInterfaces, allFaults); } }
private void processInterface(Interface serviceInterface) throws AxisFault { // TODO copy the policy elements // copyExtensionAttributes(wsdl4jPortType.getExtensionAttributes(), // axisService, PORT_TYPE); InterfaceOperation[] interfaceOperations = serviceInterface .getInterfaceOperations(); for (int i = 0; i < interfaceOperations.length; i++) { axisService.addOperation(populateOperations(interfaceOperations[i])); operationNames.add(interfaceOperations[i].getName()); } Interface[] extendedInterfaces = serviceInterface.getExtendedInterfaces(); for (int i = 0; i < extendedInterfaces.length; i++) { Interface extendedInterface = extendedInterfaces[i]; processInterface(extendedInterface); } }
private void processInterface(Interface serviceInterface) throws AxisFault { // TODO copy the policy elements // copyExtensionAttributes(wsdl4jPortType.getExtensionAttributes(), // axisService, PORT_TYPE); InterfaceOperation[] interfaceOperations = serviceInterface .getInterfaceOperations(); for (int i = 0; i < interfaceOperations.length; i++) { axisService.addOperation(populateOperations(interfaceOperations[i])); operationNames.add(interfaceOperations[i].getName()); } Interface[] extendedInterfaces = serviceInterface.getExtendedInterfaces(); for (int i = 0; i < extendedInterfaces.length; i++) { Interface extendedInterface = extendedInterfaces[i]; processInterface(extendedInterface); } }
public void validate(Object target, WodenContext wodenCtx) throws WSDLException { Interface interfac = (Interface)target; Interface[] extendedInterfaces = interfac.getExtendedInterfaces(); if(containsInterface(interfac, extendedInterfaces)) { try { wodenCtx.getErrorReporter().reportError(new ErrorLocatorImpl(), ID , new Object[]{interfac.getName()}, ErrorReporter.SEVERITY_ERROR); }catch(WSDLException e) { //TODO: Log problem reporting error. } } }
/** * Test assertion Interface-1009. An interface cannot appear, either directly or indirectly, * in the list of interfaces it extends. * * @param interfac The interface to check. * @param errorReporter The error reporter. * @return True if the assertion passes, false otherwise. * @throws WSDLException */ protected boolean testAssertionInterface1009(Interface interfac, ErrorReporter errorReporter) throws WSDLException { Interface[] extendedInterfaces = interfac.getExtendedInterfaces(); Interface extendedInterface = containsInterface(interfac, extendedInterfaces); if(extendedInterface != null) { errorReporter.reportError(new ErrorLocatorImpl(), "Interface-1009", new Object[]{extendedInterface.getName()}, ErrorReporter.SEVERITY_ERROR); return false; } return true; }
public void validate(Object target, WodenContext wodenCtx) throws WSDLException { Interface interfac = (Interface)target; Interface[] extendedInterfaces = interfac.getExtendedInterfaces(); if(containsInterface(interfac, extendedInterfaces)) { try { wodenCtx.getErrorReporter().reportError(new ErrorLocatorImpl(), ID , new Object[]{interfac.getName()}, ErrorReporter.SEVERITY_ERROR); }catch(WSDLException e) { //TODO: Log problem reporting error. } } }
allInterfaceOperationsHaveBinding = false; Interface[] extendedInterfaces = interfac.getExtendedInterfaces(); if(extendedInterfaces != null)
/** * Test assertion Interface-1009. An interface cannot appear, either directly or indirectly, * in the list of interfaces it extends. * * @param interfac The interface to check. * @param errorReporter The error reporter. * @return True if the assertion passes, false otherwise. * @throws WSDLException */ protected boolean testAssertionInterface1009(Interface interfac, ErrorReporter errorReporter) throws WSDLException { Interface[] extendedInterfaces = interfac.getExtendedInterfaces(); Interface extendedInterface = containsInterface(interfac, extendedInterfaces); if(extendedInterface != null) { errorReporter.reportError(new ErrorLocatorImpl(), "Interface-1009", new Object[]{extendedInterface.getName()}, ErrorReporter.SEVERITY_ERROR); return false; } return true; }
allInterfaceOperationsHaveBinding = false; Interface[] extendedInterfaces = interfac.getExtendedInterfaces(); if(extendedInterfaces != null)