@Override public List<UnknownSchemaNode> getUnknownSchemaNodes() { final List<UnknownSchemaNode> result = new ArrayList<>(); for (Module module : getModules()) { result.addAll(module.getUnknownSchemaNodes()); } return Collections.unmodifiableList(result); }
@Override public List<UnknownSchemaNode> getUnknownSchemaNodes() { final List<UnknownSchemaNode> result = new ArrayList<>(); for (Module module : getModules()) { result.addAll(module.getUnknownSchemaNodes()); } return Collections.unmodifiableList(result); }
/** * Find all annotations supported by a SchemaContext. * * @param context SchemaContext to search * @return {@link AnnotationSchemaNode}s supported by the SchemaContext.. * @throws NullPointerException if context is null */ static Map<QName, AnnotationSchemaNode> findAll(final SchemaContext context) { final Builder<QName, AnnotationSchemaNode> builder = ImmutableMap.builder(); for (Module module : context.getModules()) { for (UnknownSchemaNode node : module.getUnknownSchemaNodes()) { if (node instanceof AnnotationSchemaNode) { final AnnotationSchemaNode annotation = (AnnotationSchemaNode) node; builder.put(annotation.getQName(), annotation); } } } return builder.build(); } }
/** * Find specified annotation if it is supported by the specified SchemaContext. * * @param context SchemaContext to search * @param qname Annotation name * @return {@link AnnotationSchemaNode} corresponding to specified name, or empty if it is not supported * by the SchemaContext.. * @throws NullPointerException if any of the arguments is null */ static Optional<AnnotationSchemaNode> find(final SchemaContext context, final QName qname) { return context.findModule(qname.getModule()).flatMap(module -> { return module.getUnknownSchemaNodes().stream() .filter(AnnotationSchemaNode.class::isInstance) .map(AnnotationSchemaNode.class::cast) .filter(annotation -> qname.equals(annotation.getQName())).findAny(); }); }
List<UnknownSchemaNode> _unknownSchemaNodes = module.getUnknownSchemaNodes(); boolean _isNullOrEmpty_10 = IterableExtensions.isNullOrEmpty(_unknownSchemaNodes); boolean _not_10 = (!_isNullOrEmpty_10); _builder.newLine(); _builder.append(" "); List<UnknownSchemaNode> _unknownSchemaNodes_1 = module.getUnknownSchemaNodes(); CharSequence _writeUnknownSchemaNodes = YangTemplate.writeUnknownSchemaNodes(_unknownSchemaNodes_1); _builder.append(_writeUnknownSchemaNodes, " ");