本文整理汇总了Java中javax.wsdl.Import类的典型用法代码示例。如果您正苦于以下问题:Java Import类的具体用法?Java Import怎么用?Java Import使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Import类属于javax.wsdl包,在下文中一共展示了Import类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getExtensibilityElements
import javax.wsdl.Import; //导入依赖的package包/类
private static List<ExtensibilityElement> getExtensibilityElements(Definition definition) {
List<ExtensibilityElement> elements = new ArrayList<ExtensibilityElement>();
Types types = definition.getTypes();
if (types != null) {
elements.addAll(definition.getExtensibilityElements());
elements.addAll(types.getExtensibilityElements());
}
Iterator<List<Import>> wsdlImports = definition.getImports().values().iterator();
while (wsdlImports.hasNext()) {
List<Import> imports = wsdlImports.next();
int size = imports.size();
for (int i = 0; i < size; i++) {
elements.addAll(getExtensibilityElements(imports.get(i).getDefinition()));
}
}
return elements;
}
示例2: removeImport
import javax.wsdl.Import; //导入依赖的package包/类
public Import removeImport(Import importDef) {
if (isDebugEnabled) {
log.debug(myClassName + ".removeImport(" + importDef + ")");
}
getWrappedDefinitionForUse();
Import results = null;
if (wsdlDefinition != null) {
if (hasBeenSaved) {
hasBeenUpdatedSinceSaving = true;
}
results = wsdlDefinition.removeImport(importDef);
}
doneUsingWrappedDefinition();
return results;
}
示例3: createImport
import javax.wsdl.Import; //导入依赖的package包/类
public Import createImport() {
if (isDebugEnabled) {
log.debug(myClassName + ".createImport()");
}
getWrappedDefinitionForUse();
Import results = null;
if (wsdlDefinition != null) {
if (hasBeenSaved) {
hasBeenUpdatedSinceSaving = true;
}
results = wsdlDefinition.createImport();
}
doneUsingWrappedDefinition();
return results;
}
示例4: processChanges
import javax.wsdl.Import; //导入依赖的package包/类
private void processChanges(DefaultComparison comparison, DefaultComparison.DefaultSection section,
Map<String, MapDifference.ValueDifference<Vector<Import>>> changes) {
if (changes.size() > 0) {
section.addSectionSummary(Comparison.SectionType.CONTENT_CHANGE, ComparatorConstants.CHANGED_IMPORTS);
DefaultComparison.DefaultSection.DefaultTextChangeContent content = section.newTextChangeContent();
DefaultComparison.DefaultSection.DefaultTextChange change = section.newTextChange();
Vector<Import> left = new Vector<>();
Vector<Import> right = new Vector<>();
for (MapDifference.ValueDifference<Vector<Import>> diff : changes.values()) {
left.add(diff.leftValue().firstElement());
right.add(diff.rightValue().firstElement());
}
change.setOriginal(getImportsOnly(left));
change.setChanged(getImportsOnly(right));
content.setContent(change);
section.addContent(Comparison.SectionType.CONTENT_CHANGE, content);
}
}
示例5: testCompareImportChange
import javax.wsdl.Import; //导入依赖的package包/类
public void testCompareImportChange() throws WSDLException, ComparisonException {
TestDiffGeneratorFactory factory = new TestDiffGeneratorFactory();
DiffGenerator flow = factory.getDiffGenerator();
Definition originalWSDL = WSDLTestUtils.getWSDLDefinition();
Definition changedWSDL = WSDLTestUtils.getWSDLDefinition();
Import imports1 = originalWSDL.createImport();
imports1.setNamespaceURI("http://www.importnamespace.com");
imports1.setLocationURI("http://www.importlocation.com");
originalWSDL.addImport(imports1);
Import imports2 = changedWSDL.createImport();
imports2.setNamespaceURI("http://www.importnamespace.com");
imports2.setLocationURI("http://www.importlocation.com/change");
changedWSDL.addImport(imports2);
Comparison comparison = flow.compare(originalWSDL, changedWSDL, ComparatorConstants.WSDL_MEDIA_TYPE);
WSDLComparisonUtils.print(comparison);
assertNotNull(comparison);
}
示例6: getWsdlImportAddress
import javax.wsdl.Import; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private String getWsdlImportAddress(Definition definition)
{
Collection<Import> imports = definition.getImports(NAMESPACE_IMP);
if (imports.size() == 1) {
return imports.iterator().next().getLocationURI();
}
return null;
}
示例7: SchemaUtil
import javax.wsdl.Import; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public SchemaUtil(Definition wsdlDefinition) {
if (null != wsdlDefinition.getTypes()) {
init(wsdlDefinition.getTypes());
}
for (Collection<Import> wsdlImports : (Collection<Collection<Import>>) wsdlDefinition.getImports().values()) {
for (Import wsdlImport : wsdlImports) {
if (null != wsdlImport.getDefinition().getTypes()) {
init(wsdlImport.getDefinition().getTypes());
}
}
}
}
示例8: appendImportDifinitions
import javax.wsdl.Import; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static void appendImportDifinitions(Definition definition, ZipOutputStream zipOs) throws IOException, WSDLException {
for (Collection<Import> vector : (Collection<Collection<Import>>)definition.getImports().values()) {
for (Import impt : vector) {
zipOs.putNextEntry(new ZipEntry(impt.getLocationURI()));
WSDLFactory.newInstance().newWSDLWriter().writeWSDL(impt.getDefinition(), zipOs);
appendImportDifinitions(impt.getDefinition(), zipOs);
}
}
}
示例9: getAllServices
import javax.wsdl.Import; //导入依赖的package包/类
/**
* This method is an utility method that that handling the cyclic dependent wsdl imports, and wraps javax.wsdl.Definition.getServices.
* Functions similar to javax.wsdl.Definition.getAllServices(this cannot handle cyclic wsdl imports).
* @param wsdlDefinition
* @param traversedDefinitionList
* @return
*/
private Map<QName, javax.wsdl.Service> getAllServices(Definition wsdlDefinition, List<String> traversedDefinitionList) {
final Map<QName, javax.wsdl.Service> servicesMap = new HashMap<QName, javax.wsdl.Service>();
//return if already processed. this avoids cyclic dependencies.
if (traversedDefinitionList.contains(wsdlDefinition.getTargetNamespace())) {
return null;
}
traversedDefinitionList.add(wsdlDefinition.getTargetNamespace());
//process the imports
for (Object imprtCol : wsdlDefinition.getImports().values()) {
Vector<Import> importVector = (Vector) imprtCol;
for (Import importEel : importVector) {
if (importEel.getDefinition() == null) {
continue;
}
Map<QName, javax.wsdl.Service> childMap = getAllServices(importEel.getDefinition(), traversedDefinitionList);
if (childMap != null) {
servicesMap.putAll(childMap);
}
}
}
//process the root node
if (!wsdlDefinition.getServices().isEmpty()) {
servicesMap.putAll(wsdlDefinition.getServices());
}
return servicesMap;
}
示例10: addImport
import javax.wsdl.Import; //导入依赖的package包/类
public void addImport(Import importDef) {
if (isDebugEnabled) {
log.debug(myClassName + ".addImport(" + importDef + ")");
}
if (wsdlDefinition != null) {
wsdlDefinition.addImport(importDef);
}
}
示例11: removeImport
import javax.wsdl.Import; //导入依赖的package包/类
public Import removeImport(Import importDef) {
if (isDebugEnabled) {
log.debug(myClassName + ".removeImport(" + importDef + ")");
}
if (wsdlDefinition != null) {
return wsdlDefinition.removeImport(importDef);
}
return null;
}
示例12: createImport
import javax.wsdl.Import; //导入依赖的package包/类
public Import createImport() {
if (isDebugEnabled) {
log.debug(myClassName + ".createImport()");
}
if (wsdlDefinition != null) {
return wsdlDefinition.createImport();
}
return null;
}
示例13: addImport
import javax.wsdl.Import; //导入依赖的package包/类
public void addImport(Import importDef) {
if (isDebugEnabled) {
log.debug(myClassName + ".addImport(" + importDef + ")");
}
getWrappedDefinitionForUse();
if (wsdlDefinition != null) {
if (hasBeenSaved) {
hasBeenUpdatedSinceSaving = true;
}
wsdlDefinition.addImport(importDef);
}
doneUsingWrappedDefinition();
}
示例14: compareImports
import javax.wsdl.Import; //导入依赖的package包/类
protected void compareImports(Map<String, Vector<Import>> base, Map<String, Vector<Import>> changed,
DefaultComparison comparison) {
DefaultComparison.DefaultSection section = null;
MapDifference<String, Vector<Import>> mapDiff = Maps.difference(base, changed);
//If both side imports are equal, return
if (mapDiff.areEqual()) {
return;
}
Map<String, Vector<Import>> additions = mapDiff.entriesOnlyOnRight();
if (section == null && additions.size() > 0) {
section = comparison.newSection();
}
processAdditions(comparison, section, additions);
Map<String, Vector<Import>> removals = mapDiff.entriesOnlyOnLeft();
if (section == null && removals.size() > 0) {
section = comparison.newSection();
}
processRemovals(comparison, section, removals);
Map<String, MapDifference.ValueDifference<Vector<Import>>> changes = mapDiff.entriesDiffering();
if (section == null && changes.size() > 0) {
section = comparison.newSection();
}
processChanges(comparison, section, changes);
if (section != null) {
comparison.addSection(ComparatorConstants.WSDL_IMPORTS, section);
}
}
示例15: processAdditions
import javax.wsdl.Import; //导入依赖的package包/类
private void processAdditions(DefaultComparison comparison, DefaultComparison.DefaultSection section,
Map<String, Vector<Import>> additions) {
if (additions.size() > 0) {
section.addSectionSummary(Comparison.SectionType.CONTENT_ADDITION, ComparatorConstants.NEW_IMPORTS);
DefaultComparison.DefaultSection.DefaultTextContent content = section.newTextContent();
content.setContent(getImportsOnly(additions));
section.addContent(Comparison.SectionType.CONTENT_ADDITION, content);
}
}