Examples of XTag


Examples of xjavadoc.XTag

     *            description="The valid values for the parameter, comma separated. An error message is printed if the parameter value is not one of the values."
     */
    public String paramValue(Properties attributes)
        throws XDocletException
    {
        XTag cTag = getCurrentClassTag();
        XTag mTag = getCurrentMethodTag();

        String validValues = attributes.getProperty("values");
        String paramName = attributes.getProperty("paramName");
        String tagName = getCurrentTagName();

        if(DEBUG) logger.debug("current class: " + getCurrentClass().getName());
        if(DEBUG) logger.debug("cTag value for attribute \"" +
                                            attributes.getProperty("paramName") + "\" is " +
                                            (cTag != null ? cTag.getAttributeValue(attributes.getProperty("paramName")) : "null"));

        XProgramElement member = null;
        String value = null;
        if(cTag != null)
        {
            value = cTag.getAttributeValue(paramName);
            member = getCurrentClass();
        }
        else if(mTag != null)
        {
            value = mTag.getAttributeValue(paramName);
            member = getCurrentMethod();
        }

        // a value was found. perform sanity checks on valid values
        if (validValues != null)
View Full Code Here

Examples of xjavadoc.XTag

                XMethod xm = (XMethod)methods.next();

                if(DEBUG)
                    logger.debug("handle method: " + xm.getName());

                XTag attribute = getFirstTag(getCurrentClass(), xm.getName(), tagName);

                setCurrentMethod(xm);
                setCurrentMethodTag(attribute);

                if(getCurrentMethod() != null && attribute != null)
View Full Code Here

Examples of xjavadoc.XTag

                // 0) @netui:attribute -- there are not TLDX properties, but the attribute still needs to be created
                // 1) @netui.tldx:attribute -- specify TLDX properties
                // 2) @netui.tldx:attribute name="propName" -- use this for a class-level attribute when there can't be a method level one

                // get all @netui:attribute annotated methods
                XTag tldAttribute = getFirstTag(getCurrentClass(), xm.getName(), NETUI_ATTRIBUTE);

                //if(tldAttribute == null) continue;
                //setCurrentMethod(xm);

                // @netui.tldx:attribute
                if(tldAttribute != null)
                {
                    if(genTldx)
                    {
                        // if the attribute has been omitted in the TLD, omit in the TLDX
                        //
                        // @todo: this needs to happen from the class-level
                        //
                        XTag classTldOverride = getOverrideClassTag(xm.getPropertyName(), NETUI_ATTRIBUTE, getCurrentClass());
                        if(classTldOverride != null && TypeConversionUtil.stringToBoolean(classTldOverride.getAttributeValue("hide"), false))
                            continue;

                        // get the first @netui.tldx:attribute tag if it exists
                        XTag tldxAttribute = getFirstTag(getCurrentClass(), xm.getName(), NETUI_TLDX_ATTRIBUTE);
                       
                        // if(DEBUG) logger.debug("found @netui.tldx:attribute tag on method: " + tldxAttribute);
                       
                        if(tldxAttribute != null)
                            setCurrentMethodTag(tldxAttribute);
                    }
                    // @netui-tld:attribute
                    else if(tldAttribute != null)
                        setCurrentMethodTag(tldAttribute);
                    
                    XTag tag = getOverrideClassTag(xm.getPropertyName(), getCurrentTagName(), getCurrentClass());
                   
                    if(tag != null)
                        setCurrentClassTag(tag);

                    setCurrentMethod(xm);
View Full Code Here

Examples of xjavadoc.XTag

    {
        // look for a class override for either netui:attribute or netui.tldx:attribute, depending on the current tagName
        Iterator iterator = currentClass.getDoc().getTags(tagName, false).iterator();
        while(iterator.hasNext())
        {
            XTag tag = (XTag)iterator.next();
//             System.out.println("check class-level tag named " + tag.getName() + " with name attribute " + tag.getAttributeValue("name") + " searching for: " + name);
           
            if(tag.getAttributeValue("name").equals(name))
            {
                // if(DEBUG) logger.debug("setting class tag");
                return tag;
            }
        }
View Full Code Here

Examples of xjavadoc.XTag

       
        if ( tags == null ) return annotations;
       
        for ( Iterator i = tags.iterator(); i.hasNext(); )
        {
            XTag tag = ( XTag ) i.next();
            AnnotationTypeDeclaration decl = ( AnnotationTypeDeclaration ) ANNOTATIONS.get( tag.getName() );
           
            if ( decl != null )
            {
                AnnotationType type = new AnnotationTypeImpl( decl );
                Collection attrNames = tag.getAttributeNames();           
                HashMap elementValues = new HashMap();
               
                for ( Iterator j = attrNames.iterator(); j.hasNext(); )
                {
                    String attrName = ( String ) j.next();
                    AnnotationTypeElementDeclaration memberDecl = decl.getMember( attrName );
                    SourcePositionImpl pos = SourcePositionImpl.get( tag, attrName, element );
                    Object val = parseValue( memberDecl, tag.getAttributeValue( attrName ), pos );
                    AnnotationValue value = new AnnotationValueImpl( val, pos, memberDecl );
                    elementValues.put( memberDecl, value );
                }
               
                AnnotationInstanceImpl ann = new AnnotationInstanceImpl( tag, element, type, elementValues );
               
                String memberName = ( String ) MEMBER_ARRAY_ANNOTATIONS.get( tag.getName() );
               
                if ( memberName != null )
                {
                    if ( ! addAnnotationToParent( annotations, ann, memberName, true, parentAnnotations ) )
                    {
                        annotations.add( ann );
                    }
                }
                else if ( ( memberName = ( String ) MEMBER_ANNOTATIONS.get( tag.getName() ) ) != null )
                {
                    if ( ! addAnnotationToParent( annotations, ann, memberName, false, parentAnnotations ) )
                    {
                        annotations.add( ann );
                    }
View Full Code Here

Examples of xjavadoc.XTag

   
    protected void addExpressions (Collection tags, String selector, PrintWriter pw, String collectionName, File sourceFile) {
        String fileName = sourceFile != null ? sourceFile.getPath ().replace ('\\', '/') : "<unknown>";
        Iterator iter = tags.iterator ();
        while (iter.hasNext ()) {
            XTag tag = (XTag) iter.next ();
           
            if (isAttribute (tag)) {
                String expression = tag.getName () + " " + tag.getValue ();
                expression = expression.trim ();
               
                // Remove the second @-sign.
                expression = expression.substring (1);
               
                if (selector != null) {
                    if (expression.startsWith (".")) {
                        // We have selector, tag does...
                        String tagSelector = expression.substring (1, expression.indexOf (" "));
                        expression = expression.substring (expression.indexOf (" ")).trim ();
                        if (!selector.equals (tagSelector)) {
                            // ...but they didn't match.
                            continue;
                        }
                    } else {
                        // We have selector, but tag doesn't
                        continue;
                    }
                } else {
                    // No selector, but tag has selector.
                    if (expression.startsWith (".")) {
                        continue;
                    }
                }
               
                pw.println ("        {");
                outputAttributeExpression (pw, expression, fileName, tag.getLineNumber (), "_attr");
                pw.println ("        Object _oattr = _attr; // Need to erase type information");
                pw.println ("        if (_oattr instanceof org.apache.commons.attributes.Sealable) {");
                pw.println ("            ((org.apache.commons.attributes.Sealable) _oattr).seal ();");
                pw.println ("        }");
                pw.println ("        " + collectionName + ".add ( _attr );");
View Full Code Here

Examples of xjavadoc.XTag

     * Checks if a collection of XTags contain any tags specifying attributes.
     */
    protected boolean tagHasAttributes (Collection tags) {
        Iterator iter = tags.iterator ();
        while (iter.hasNext ()) {
            XTag tag = (XTag) iter.next ();
            if (isAttribute (tag)) {
                return true;
            }
        }
        return false;
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.