src/main/java/org/xmlet/xsdparser/xsdelements/visitors/AttributesVisitor.java
public void replaceUnsolvedAttributes(NamedConcreteElement element){
        if (element.getElement() instanceof XsdAttributeGroup){
            attributeGroups.stream()
                    .filter(attributeGroup -> attributeGroup instanceof UnsolvedReference && ((UnsolvedReference) attributeGroup).getRef().equals(element.getName()))
                    .findFirst().ifPresent(referenceBase -> {
                attributeGroups.remove(referenceBase);
                attributeGroups.add(element);
                attributes.addAll(element.getElement().getElements());

                element.getElement().setParent(getOwner());
            });
        }

        if (element.getElement() instanceof XsdAttribute ){
            attributes.stream()
                    .filter(attribute -> attribute instanceof UnsolvedReference && ((UnsolvedReference) attribute).getRef().equals(element.getName()))
                    .findFirst().ifPresent(referenceBase -> {
                attributes.remove(referenceBase);
                attributes.add(element);
                element.getElement().setParent(getOwner());
            });
        }
    }
public void replaceUnsolvedAttributes(NamedConcreteElement element){
        if (element.getElement() instanceof XsdAttributeGroup){
            attributeGroups.stream()
                    .filter(attributeGroup -> attributeGroup instanceof UnsolvedReference && ((UnsolvedReference) attributeGroup).getRef().equals(element.getName()))
                    .findFirst().ifPresent(referenceBase -> {
                attributeGroups.remove(referenceBase);
                attributeGroups.add(element);
                attributes.addAll(element.getElement().getElements());

                element.getElement().setParent(getOwner());
            });
        }

        if (element.getElement() instanceof XsdAttribute ){
            attributes.stream()
                    .filter(attribute -> attribute instanceof UnsolvedReference && ((UnsolvedReference) attribute).getRef().equals(element.getName()))
                    .findFirst().ifPresent(referenceBase -> {
                attributes.remove(referenceBase);
                attributes.add(element);
                element.getElement().setParent(getOwner());
            });
        }
    }
public void replaceUnsolvedAttributes ( NamedConcreteElement element ) { if ( element . getElement ( ) instanceof XsdAttributeGroup ) { attributeGroups . stream ( ) . filter ( attributeGroup -> attributeGroup instanceof UnsolvedReference && ( ( UnsolvedReference ) attributeGroup ) . getRef ( ) . equals ( element . getName ( ) ) ) . findFirst ( ) . ifPresent ( referenceBase -> { attributeGroups . remove ( referenceBase ) ; attributeGroups . add ( element ) ; attributes . addAll ( element . getElement ( ) . getElements ( ) ) ; element . getElement ( ) . setParent ( getOwner ( ) ) ; } ) ; } if ( element . getElement ( ) instanceof XsdAttribute ) { attributes . stream ( ) . filter ( attribute -> attribute instanceof UnsolvedReference && ( ( UnsolvedReference ) attribute ) . getRef ( ) . equals ( element . getName ( ) ) ) . findFirst ( ) . ifPresent ( referenceBase -> { attributes . remove ( referenceBase ) ; attributes . add ( element ) ; element . getElement ( ) . setParent ( getOwner ( ) ) ; } ) ; } }
Tries to match the received {@link NamedConcreteElement} object, with any of the elements present either in
{@link AttributesVisitor#attributeGroups} or {@link AttributesVisitor#attributes}. If a match occurs this method
performs all the required actions to fully exchange the {@link UnsolvedReference} object with the element parameter.
@param element The resolved element that will be match with the contents of this visitor in order to assert if
there is anything to replace.
Tries to match the received {