当前位置 : 主页 > 网络编程 > 其它编程 >

com.webcohesion.enunciate.facets.FacetFilter.accept()方法的使用及代码示例

来源:互联网 收集:自由互联 发布时间:2023-07-02
本文整理了Java中com.webcohesion.enunciate.facets.FacetFilter.accept()方法的一些代码示例,展示了Fa 本文整理了Java中com.webcohesion.enunciate.facets.FacetFilter.accept()方法的一些代码示例,展示了FacetFilte
本文整理了Java中com.webcohesion.enunciate.facets.FacetFilter.accept()方法的一些代码示例,展示了Fa

本文整理了Java中com.webcohesion.enunciate.facets.FacetFilter.accept()方法的一些代码示例,展示了FacetFilter.accept()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FacetFilter.accept()方法的具体详情如下:包路径:com.webcohesion.enunciate.facets.FacetFilter类名称:FacetFilter方法名:accept

FacetFilter.accept介绍

暂无

代码示例

代码示例来源:origin: stoicflame/enunciate

/** * Returns the qname of the element that has the first parameter as the namespace, the second as the element. * * @param list The arguments. * @return The qname. */public Object exec(List list) throws TemplateModelException { if (list.size() <1) { throw new TemplateModelException("The IsFacetExcluded method must have a declaration as a parameter."); } TemplateModel from = (TemplateModel) list.get(0); Object unwrapped = BeansWrapper.getDefaultInstance().unwrap(from); if (unwrapped instanceof Collection) { if (!((Collection)unwrapped).isEmpty()) { for (Object item : (Collection) unwrapped) { if (HasFacets.class.isInstance(item) } } return true; } return false; } else { return HasFacets.class.isInstance(unwrapped) }}

代码示例来源:origin: stoicflame/enunciate

public List getResourceGroupsByPath(ApiRegistrationContext registrationContext) { Map resourcesByPath = new HashMap(); FacetFilter facetFilter = context.getConfiguration().getFacetFilter(); for (SpringController springController : controllers) { if (!facetFilter.accept(springController)) { continue; } for (RequestMapping method : springController.getRequestMappings()) { if (facetFilter.accept(method)) { String path = method.getFullpath(); PathBasedResourceGroupImpl resourceGroup = resourcesByPath.get(path); if (resourceGroup == null) { resourceGroup = new PathBasedResourceGroupImpl(relativeContextPath, path, new ArrayList()); resourcesByPath.put(path, resourceGroup); } resourceGroup.getResources().add(new ResourceImpl(method, resourceGroup, registrationContext)); } } } ArrayList resourceGroups = new ArrayList(resourcesByPath.values()); Collections.sort(resourceGroups, new ResourceGroupComparator(this.pathSortStrategy)); return resourceGroups;}

代码示例来源:origin: stoicflame/enunciate

public List getResourceGroupsByClass(ApiRegistrationContext registrationContext) { List resourceGroups = new ArrayList(); Set slugs = new TreeSet(); FacetFilter facetFilter = context.getConfiguration().getFacetFilter(); for (SpringController springController : controllers) { if (!facetFilter.accept(springController)) { continue; } String slug = springController.getSimpleName().toString(); if (slugs.contains(slug)) { slug = ""; String[] qualifiedNameTokens = springController.getQualifiedName().toString().split("\\."); for (int i = qualifiedNameTokens.length - 1; i >= 0; i--) { slug = slug.isEmpty() ? qualifiedNameTokens[i] : slug + "_" + qualifiedNameTokens[i]; if (!slugs.contains(slug)) { break; } } } slugs.add(slug); ResourceGroup group = new ResourceClassResourceGroupImpl(springController, slug, relativeContextPath, registrationContext); if (!group.getResources().isEmpty()) { resourceGroups.add(group); } } Collections.sort(resourceGroups, new ResourceGroupComparator(this.pathSortStrategy)); return resourceGroups;}

代码示例来源:origin: stoicflame/enunciate

@Overridepublic List getOperations() { ArrayList operatiOns= new ArrayList(); FacetFilter facetFilter = this.ei.getContext().getContext().getConfiguration().getFacetFilter(); for (WebMethod webMethod : this.ei.getWebMethods()) { if (facetFilter.accept(webMethod)) { operations.add(new OperationImpl(webMethod, this, registrationContext)); } } return operations;}

代码示例来源:origin: stoicflame/enunciate

@Overridepublic List getValues() { FacetFilter facetFilter = this.typeDefinition.getContext().getContext().getConfiguration().getFacetFilter(); List enumValues = this.typeDefinition.getEnumValues(); ArrayList values = new ArrayList(enumValues.size()); for (EnumValue enumValue : enumValues) { if (enumValue.getValue() != null) { if (!facetFilter.accept(enumValue)) { continue; } values.add(createValue(enumValue)); } } return values;}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jackson1

@Override public List getTypes() { Collection typeDefinitiOns= this.context.getTypeDefinitions(); ArrayList dataTypes = new ArrayList(); FacetFilter facetFilter = this.context.getContext().getConfiguration().getFacetFilter(); for (TypeDefinition typeDefinition : typeDefinitions) { if (!facetFilter.accept(typeDefinition)) { continue; } if (typeDefinition instanceof ObjectTypeDefinition) { dataTypes.add(new ObjectDataTypeImpl((ObjectTypeDefinition) typeDefinition, registrationContext)); } else if (typeDefinition instanceof EnumTypeDefinition) { dataTypes.add(new EnumDataTypeImpl((EnumTypeDefinition) typeDefinition, registrationContext)); } } Collections.sort(dataTypes, new Comparator() { @Override public int compare(DataType o1, DataType o2) { return o1.getLabel().compareTo(o2.getLabel()); } }); return dataTypes; }}

代码示例来源:origin: stoicflame/enunciate

@Override public List getServices() { ArrayList services = new ArrayList(); FacetFilter facetFilter = this.wsdlInfo.getContext().getContext().getConfiguration().getFacetFilter(); for (EndpointInterface endpointInterface : this.wsdlInfo.getEndpointInterfaces()) { if (!facetFilter.accept(endpointInterface)) { continue; } services.add(new ServiceImpl(endpointInterface, "", registrationContext)); } Collections.sort(services, new Comparator() { @Override public int compare(Service o1, Service o2) { return o1.getLabel().compareTo(o2.getLabel()); } }); return services; }}

代码示例来源:origin: stoicflame/enunciate

@Override public List getTypes() { Collection typeDefinitiOns= this.context.getTypeDefinitions(); ArrayList dataTypes = new ArrayList(); FacetFilter facetFilter = this.context.getContext().getConfiguration().getFacetFilter(); for (TypeDefinition typeDefinition : typeDefinitions) { if (!facetFilter.accept(typeDefinition)) { continue; } if (typeDefinition instanceof ObjectTypeDefinition) { dataTypes.add(new ObjectDataTypeImpl((ObjectTypeDefinition) typeDefinition, registrationContext)); } else if (typeDefinition instanceof EnumTypeDefinition) { dataTypes.add(new EnumDataTypeImpl((EnumTypeDefinition) typeDefinition, registrationContext)); } } Collections.sort(dataTypes, new Comparator() { @Override public int compare(DataType o1, DataType o2) { return o1.getLabel().compareTo(o2.getLabel()); } }); return dataTypes; }}

代码示例来源:origin: stoicflame/enunciate

@Override public List getTypes() { Collection typeDefinitiOns= this.context.getTypeDefinitions(); ArrayList dataTypes = new ArrayList(); FacetFilter facetFilter = this.context.getContext().getConfiguration().getFacetFilter(); for (TypeDefinition typeDefinition : typeDefinitions) { if (!facetFilter.accept(typeDefinition)) { continue; } if (typeDefinition instanceof ObjectTypeDefinition) { dataTypes.add(new ObjectDataTypeImpl((ObjectTypeDefinition) typeDefinition, registrationContext)); } else if (typeDefinition instanceof EnumTypeDefinition) { dataTypes.add(new EnumDataTypeImpl((EnumTypeDefinition) typeDefinition, registrationContext)); } } Collections.sort(dataTypes, new Comparator() { @Override public int compare(DataType o1, DataType o2) { return o1.getLabel().compareTo(o2.getLabel()); } }); return dataTypes; }}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jackson

@Overridepublic List getValues() { FacetFilter facetFilter = this.typeDefinition.getContext().getContext().getConfiguration().getFacetFilter(); List enumValues = this.typeDefinition.getEnumValues(); ArrayList values = new ArrayList(enumValues.size()); for (EnumValue enumValue : enumValues) { if (enumValue.getValue() != null) { if (!facetFilter.accept(enumValue)) { continue; } values.add(createValue(enumValue)); } } return values;}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jackson1

@Overridepublic List getValues() { FacetFilter facetFilter = this.typeDefinition.getContext().getContext().getConfiguration().getFacetFilter(); List enumValues = this.typeDefinition.getEnumValues(); ArrayList values = new ArrayList(enumValues.size()); for (EnumValue enumValue : enumValues) { if (enumValue.getValue() != null) { if (!facetFilter.accept(enumValue)) { continue; } values.add(createValue(enumValue)); } } return values;}

代码示例来源:origin: stoicflame/enunciate

@Overridepublic List getValues() { FacetFilter facetFilter = this.typeDefinition.getContext().getContext().getConfiguration().getFacetFilter(); List enumValues = this.typeDefinition.getEnumValues(); ArrayList values = new ArrayList(enumValues.size()); for (EnumValue enumValue : enumValues) { if (enumValue.getValue() != null) { if (!facetFilter.accept(enumValue)) { continue; } values.add(createValue(enumValue)); } } return values;}

代码示例来源:origin: stoicflame/enunciate

@Overridepublic List getValues() { FacetFilter facetFilter = this.typeDefinition.getContext().getContext().getConfiguration().getFacetFilter(); List enumValues = this.typeDefinition.getEnumValues(); ArrayList values = new ArrayList(enumValues.size()); for (EnumValue enumValue : enumValues) { if (enumValue.getValue() != null) { if (!facetFilter.accept(enumValue)) { continue; } values.add(createValue(enumValue)); } } return values;}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jaxb

@Overridepublic List getValues() { FacetFilter facetFilter = this.typeDefinition.getContext().getContext().getConfiguration().getFacetFilter(); List enumValues = this.typeDefinition.getEnumValues(); ArrayList values = new ArrayList(enumValues.size()); for (EnumValue enumValue : enumValues) { if (enumValue.getValue() != null) { if (!facetFilter.accept(enumValue)) { continue; } values.add(createValue(enumValue)); } } return values;}

代码示例来源:origin: stoicflame/enunciate

@Override public List getTypes() { FacetFilter facetFilter = this.schema.getContext().getContext().getConfiguration().getFacetFilter(); ArrayList dataTypes = new ArrayList(); for (TypeDefinition typeDefinition : this.schema.getTypeDefinitions()) { if (!facetFilter.accept(typeDefinition)) { continue; } if (typeDefinition instanceof ComplexTypeDefinition) { dataTypes.add(new ComplexDataTypeImpl((ComplexTypeDefinition) typeDefinition, registrationContext)); } else if (typeDefinition instanceof EnumTypeDefinition) { dataTypes.add(new EnumDataTypeImpl((EnumTypeDefinition) typeDefinition, registrationContext)); } } return dataTypes; }}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jaxb

@Override public List getTypes() { FacetFilter facetFilter = this.schema.getContext().getContext().getConfiguration().getFacetFilter(); ArrayList dataTypes = new ArrayList(); for (TypeDefinition typeDefinition : this.schema.getTypeDefinitions()) { if (!facetFilter.accept(typeDefinition)) { continue; } if (typeDefinition instanceof ComplexTypeDefinition) { dataTypes.add(new ComplexDataTypeImpl((ComplexTypeDefinition) typeDefinition, registrationContext)); } else if (typeDefinition instanceof EnumTypeDefinition) { dataTypes.add(new EnumDataTypeImpl((EnumTypeDefinition) typeDefinition, registrationContext)); } } return dataTypes; }}

代码示例来源:origin: com.webcohesion.enunciate/enunciate-jackson

@Override public List getTypes() { Collection typeDefinitiOns= this.context.getTypeDefinitions(); ArrayList dataTypes = new ArrayList(); FacetFilter facetFilter = this.context.getContext().getConfiguration().getFacetFilter(); for (TypeDefinition typeDefinition : typeDefinitions) { if (!facetFilter.accept(typeDefinition)) { continue; } if (typeDefinition instanceof ObjectTypeDefinition) { dataTypes.add(new ObjectDataTypeImpl((ObjectTypeDefinition) typeDefinition, registrationContext)); } else if (typeDefinition instanceof EnumTypeDefinition) { dataTypes.add(new EnumDataTypeImpl((EnumTypeDefinition) typeDefinition, registrationContext)); } } Collections.sort(dataTypes, new Comparator() { @Override public int compare(DataType o1, DataType o2) { return o1.getLabel().compareTo(o2.getLabel()); } }); return dataTypes; }}

代码示例来源:origin: stoicflame/enunciate

public List getResourceGroupsByPath(ApiRegistrationContext registrationContext) { Map resourcesByPath = new HashMap(); FacetFilter facetFilter = context.getConfiguration().getFacetFilter(); for (RootResource rootResource : rootResources) { if (!facetFilter.accept(rootResource)) { continue; } for (ResourceMethod method : rootResource.getResourceMethods(true)) { if (facetFilter.accept(method)) { com.webcohesion.enunciate.metadata.rs.ServiceContextRoot cOntext= method.getAnnotation(com.webcohesion.enunciate.metadata.rs.ServiceContextRoot.class); com.webcohesion.enunciate.modules.jaxrs.model.Resource resource = method.getParent(); while (cOntext== null resource = resource.getParent(); } String path = method.getFullpath(); PathBasedResourceGroupImpl resourceGroup = resourcesByPath.get(path); if (resourceGroup == null) { String cOntextPath= context != null ? JaxrsModule.sanitizeContextPath(context.value()) : this.relativeContextPath; resourceGroup = new PathBasedResourceGroupImpl(contextPath, path, new ArrayList()); resourcesByPath.put(path, resourceGroup); } resourceGroup.getResources().add(new ResourceImpl(method, resourceGroup, registrationContext)); } } } ArrayList resourceGroups = new ArrayList(resourcesByPath.values()); Collections.sort(resourceGroups, new ResourceGroupComparator(this.pathSortStrategy)); return resourceGroups;}

代码示例来源:origin: stoicflame/enunciate

public ResourceClassResourceGroupImpl(SpringController controllerClass, String slug, String contextPath, ApiRegistrationContext registrationContext) { this.cOntrollerClass= controllerClass; this.slug = slug; this.cOntextPath= contextPath; FacetFilter facetFilter = controllerClass.getContext().getContext().getConfiguration().getFacetFilter(); for (RequestMapping requestMapping : controllerClass.getRequestMappings()) { if (!facetFilter.accept(requestMapping)) { continue; } this.resources.add(new ResourceImpl(requestMapping, this, registrationContext)); } Collections.sort(this.resources, new ResourceComparator(controllerClass.getContext().getPathSortStrategy())); this.registratiOnContext= registrationContext;}

代码示例来源:origin: stoicflame/enunciate

public ResourceClassResourceGroupImpl(com.webcohesion.enunciate.modules.jaxrs.model.Resource resourceClass, String slug, String contextPath, ApiRegistrationContext registrationContext) { this.resourceClass = resourceClass; this.cOntextPath= contextPath; this.slug = slug; FacetFilter facetFilter = resourceClass.getContext().getContext().getConfiguration().getFacetFilter(); for (ResourceMethod resourceMethod : resourceClass.getResourceMethods(true)) { if (!facetFilter.accept(resourceMethod)) { continue; } this.resources.add(new ResourceImpl(resourceMethod, this, registrationContext)); } Collections.sort(this.resources, new ResourceComparator(resourceClass.getContext().getPathSortStrategy())); this.registratiOnContext= registrationContext;}

上一篇:layui框架属于前端还是后端
下一篇:没有了
网友评论