Examples of Elements


Examples of com.dotcms.repackage.org.jsoup.select.Elements

  public static List<PreviewFileAsset> getFilesInodes(String _body){
    Document templateBody = Jsoup.parse(_body);
    List<PreviewFileAsset> result = new ArrayList<PreviewFileAsset>();
    Element divFilesToAdd = templateBody.getElementById(FILES_TO_ADD_DIV_ID);
    if(null!=divFilesToAdd){
      Elements filesToAdd = divFilesToAdd.getElementsByAttributeValueStarting(ID_ATTRIBUTE, FILE_TO_ADD_START_ID);
      for(Element singleFile : filesToAdd){
        String id = singleFile.attr("id");
        String[] values = id.substring(id.indexOf(FILE_TO_ADD_START_ID)+4).split("_");
        PreviewFileAsset p = new PreviewFileAsset();
        p.setInode(values[0]);
View Full Code Here

Examples of com.sun.jersey.server.wadl.generators.resourcedoc.xhtml.Elements

    private void addDocForExample( final List<Doc> docs, final String example ) {
        if ( !isEmpty( example ) ) {
            final Doc doc = new Doc();
           
            final Elements pElement = Elements.el( "p" )
                .add( Elements.val( "h6", "Example" ) )
                .add( Elements.el( "pre" ).add( Elements.val( "code", example ) ) );
           
            doc.getContent().add( pElement );
            docs.add( doc );
View Full Code Here

Examples of daveayan.gherkinsalad.components.Elements

  }

  public void select_option_if_enabled(String option) {
    Element element = root_element();
    if (this.isEnabled()) {
      Elements options = element.findElements(By.tagName("option"));
      Element option_to_select = options.findFirstElementWithText(option);
      option_to_select.click();
    }
  }
View Full Code Here

Examples of daveayan.gherkinsalad.components.core.Elements

  public void select_option_if_enabled(final String option) {
    select_code_if_enabled(option);
  }

  public void select_code_if_enabled(final String code) {
    Elements root_elements = root_elements();
    Element element_to_select = root_elements.findFirstElementThatMatches(new Predicate<Element>() {
      public boolean apply(Element input) {
        String value = input.getAttribute("value");
        if(value == null) return Boolean.FALSE;
        return value.trim().equals(code);
      }
View Full Code Here

Examples of electric.xml.Elements

    {
        WebResponse rs = wc.getResponse(baseUrl + "/inline/page7.jsp");
        Document doc = getDocument(rs);
        assertEquals("{inline7} content 7 jsp", rs.getTitle());
        assertEquals("Page 7 jsp content", doc.getElementWithId("bod").getText("p").toString());
        Elements inlineContents = doc.getElements(new XPath("//[@id='inline-content']"));
        assertEquals("This is a servlet using writer to output", inlineContents.next().getText().toString());
        assertEquals("This is a servlet using stream to output", inlineContents.next().getText().toString());
    }
View Full Code Here

Examples of javax.lang.model.util.Elements

      context.addMetaEntity( fqcn, metaEntity );
    }
  }

  private boolean xmlMappedTypeExists(String fullyQualifiedClassName) {
    Elements utils = context.getElementUtils();
    return utils.getTypeElement( fullyQualifiedClassName ) != null;
  }
View Full Code Here

Examples of javax.lang.model.util.Elements

    Elements utils = context.getElementUtils();
    return utils.getTypeElement( fullyQualifiedClassName ) != null;
  }

  private TypeElement getXmlMappedType(String fullyQualifiedClassName) {
    Elements utils = context.getElementUtils();
    return utils.getTypeElement( fullyQualifiedClassName );
  }
View Full Code Here

Examples of javax.lang.model.util.Elements

            }
        }

        // favor to use class javadoc of component as description
        if (model.getJavaType() != null) {
            Elements elementUtils = processingEnv.getElementUtils();
            TypeElement typeElement = findTypeElement(roundEnv, model.getJavaType());
            if (typeElement != null) {
                String doc = elementUtils.getDocComment(typeElement);
                if (doc != null) {
                    // need to sanitize the description first (we only want a summary)
                    doc = sanitizeDescription(doc, true);
                    // the javadoc may actually be empty, so only change the doc if we got something
                    if (!Strings.isNullOrEmpty(doc)) {
View Full Code Here

Examples of javax.lang.model.util.Elements

        return model;
    }

    protected void findClassProperties(RoundEnvironment roundEnv, Set<EndpointOption> endpointOptions, TypeElement classElement, String prefix) {
        Elements elementUtils = processingEnv.getElementUtils();
        while (true) {
            List<VariableElement> fieldElements = ElementFilter.fieldsIn(classElement.getEnclosedElements());
            if (fieldElements.isEmpty()) {
                break;
            }
            for (VariableElement fieldElement : fieldElements) {
                UriParam param = fieldElement.getAnnotation(UriParam.class);
                String fieldName = fieldElement.getSimpleName().toString();
                if (param != null) {
                    String name = param.name();
                    if (isNullOrEmpty(name)) {
                        name = fieldName;
                    }
                    name = prefix + name;

                    String defaultValue = param.defaultValue();
                    String defaultValueNote = param.defaultValueNote();

                    // if the field type is a nested parameter then iterate through its fields
                    TypeMirror fieldType = fieldElement.asType();
                    String fieldTypeName = fieldType.toString();
                    TypeElement fieldTypeElement = findTypeElement(roundEnv, fieldTypeName);
                    UriParams fieldParams = null;
                    if (fieldTypeElement != null) {
                        fieldParams = fieldTypeElement.getAnnotation(UriParams.class);
                    }
                    if (fieldParams != null) {
                        String nestedPrefix = prefix;
                        String extraPrefix = fieldParams.prefix();
                        if (!isNullOrEmpty(extraPrefix)) {
                            nestedPrefix += extraPrefix;
                        }
                        findClassProperties(roundEnv, endpointOptions, fieldTypeElement, nestedPrefix);
                    } else {
                        String docComment = elementUtils.getDocComment(fieldElement);
                        if (isNullOrEmpty(docComment)) {
                            String setter = "set" + fieldName.substring(0, 1).toUpperCase();
                            if (fieldName.length() > 1) {
                                setter += fieldName.substring(1);
                            }
                            //  lets find the setter
                            List<ExecutableElement> methods = ElementFilter.methodsIn(classElement.getEnclosedElements());
                            for (ExecutableElement method : methods) {
                                String methodName = method.getSimpleName().toString();
                                if (setter.equals(methodName) && method.getParameters().size() == 1) {
                                    String doc = elementUtils.getDocComment(method);
                                    if (!isNullOrEmpty(doc)) {
                                        docComment = doc;
                                        break;
                                    }
                                }
View Full Code Here

Examples of javax.lang.model.util.Elements

        }
    }

    private Map<String, PropertyMirror> buildProperties() {
        Map<String, PropertyMirror> results = new LinkedHashMap<String, PropertyMirror>();
        Elements elementUtils = environment.getElementUtils();
        TypeElement element = (TypeElement) type.asElement();
        for (ExecutableElement method : ElementFilter.methodsIn(elementUtils.getAllMembers(element))) {
            PropertyMirror property = Util.toProperty(method);
            if (property != null) {
                results.put(property.getName(), property);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.