Package org.thymeleaf.dom

Examples of org.thymeleaf.dom.Attribute


            final Attribute[] attributes = element.unsafeGetAttributes();
            final int attributesLen = element.numAttributes();
           
            for (int i = 0; i < attributesLen; i++) {
               
                final Attribute attribute = attributes[i];
                boolean writeAttribute = true;
               
                if (attribute.getNormalizedName().startsWith("xmlns:")) {
                    // xmlns attributes related to thymeleaf-managed prefixes (prefixes assigned to any of the
                    // dialects configured at the template engine) are always removed.
                    final String xmlnsPrefix = attribute.getNormalizedName().substring("xmlns:".length());
                    if (configuration.isPrefixManaged(xmlnsPrefix)) {
                        writeAttribute = false;
                    }
                }

                if (writeAttribute) {
                   
                    writer.write(' ');
                    writer.write(attribute.getOriginalName());
                   
                    final String attrValue = attribute.getEscapedValue();
                    if (!(attrValue == null && attribute.isOnlyName())) {
                        writer.write('=');
                        writer.write('\"');
                        if (attrValue != null) {
                            writer.write(attrValue);
                        }
View Full Code Here


                        // This will ensure that the substituteby and replace processors only run for the child element
                        element.setRecomputeProcessorsImmediately(true);
                    }
                } else if (attrName.equals("th:remove")) {
                    Attribute attr = element.getAttributeMap().get(attrName);
                    if ("tag".equals(attr.getValue())) {
                        removeElement = true;

                        // The cache functionality will remove the element.
                        element.setAttribute(attrName, "none");
                    }
View Full Code Here

            Map<String,Attribute> map = ((NestableAttributeHolderNode) node).getAttributeMap();
              if (map == null || map.isEmpty()) {
                  continue;
              }
             
              Attribute attr = map.get(specifier.getName());
              if (attr == null) {
                  continue;
              }
             
              // It just have to be present.
              if (specifier.getValue() == null) {
                  result.add(node);
                  continue;
              }
             
              String value = attr.getValue().trim();
              if (value.length() != 0) {
                  String val = specifier.getValue();
                  switch (specifier.getMatch()) {
                  case EXACT:
                      if (value.equals(val)) {
View Full Code Here

TOP

Related Classes of org.thymeleaf.dom.Attribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.