Examples of XTag


Examples of xjavadoc.XTag

        return servletName(getCurrentClass());
    }

    public static String servletName(XClass clazz)
    {
        XTag beanTag = clazz.getDoc().getTag(ServiceEndpointSubTask.WEB_SERVLET);
        String paramValue = null;

        if (beanTag != null) {
            paramValue = beanTag.getAttributeValue("name");
        }

        if (paramValue == null) {
            paramValue = clazz.getName();
        }
View Full Code Here

Examples of xjavadoc.XTag

        if (doc.hasTag(SQL_TABLE_TAG)) {
            String sqlName = doc.getTagAttributeValue(SQL_TABLE_TAG, TABLE_NAME_ATTR);

            extensions.add(new VendorExtension(getVendorName(), "table", sqlName));
            if (doc.hasTag("kodo.table")) {
                XTag tag = doc.getTag("kodo.table");
                String pkColumn = tag.getAttributeValue("pk-column");
                String lockColumn = tag.getAttributeValue("lock-column");
                String classColumn = tag.getAttributeValue("class-column");

                if (pkColumn != null) {
                    extensions.add(new VendorExtension(getVendorName(), "pk-column", pkColumn));

                    String identity = doc.getTagAttributeValue("jdo.persistence-capable", "identity-type");
View Full Code Here

Examples of xjavadoc.XTag

                if (STYLE_FOREIGN_KEY_VALUE.equals(style)) {
                    Collection tags = doc.getTags(SQL_FIELD_TAG);

                    for (Iterator i = tags.iterator(); i.hasNext(); ) {
                        XTag tag = (XTag)i.next();
                        String columnName = tag.getAttributeValue(COLUMN_NAME_ATTR);
                        String relatedField = tag.getAttributeValue(RELATED_FIELD_ATTR);

                        extensions.add(new VendorExtension(getVendorName(), relatedField + "-data-column", columnName));
                    }
                }
                else {
                    LOG.warn(Translator.getString(XDocletModulesJdoMessages.class,
                        XDocletModulesJdoMessages.NOT_SUPPORTED_TAG_ATTRIBUTE_VALUE,
                        new String[]{SQL_RELATION_TAG, STYLE_ATTR, style, getVendorDescription()}));
                }
            }
            else if ("collection".equals(collectionType) || "array".equals(collectionType)) {
                String style = doc.getTagAttributeValue(SQL_RELATION_TAG, STYLE_ATTR);

                if (STYLE_FOREIGN_KEY_VALUE.equals(style)) {
                    String relatedField = doc.getTagAttributeValue(SQL_RELATION_TAG, RELATED_FIELD_ATTR);

                    extensions.add(new VendorExtension(getVendorName(), "inverse", relatedField));
                }
                else if (STYLE_RELATION_TABLE_VALUE.equals(style)) {
                    String embeddedClassName = doc.getTagAttributeValue("jdo.field", "element-type");
                    XClass embeddedClass = getXJavaDoc().getXClass(embeddedClassName);
                    String relatedCollection = doc.getTagAttributeValue(SQL_RELATION_TAG, RELATED_FIELD_ATTR);
                    XDoc relatedDoc = embeddedClass.getField(relatedCollection).getDoc();

                    extensions.add(new VendorExtension(getVendorName(), "inverse", relatedCollection));

                    String relationTable = doc.getTagAttributeValue(SQL_RELATION_TAG, TABLE_NAME_ATTR);

                    extensions.add(new VendorExtension(getVendorName(), "table", relationTable));

                    Collection tags = doc.getTags(SQL_FIELD_TAG);

                    for (Iterator i = tags.iterator(); i.hasNext(); ) {
                        XTag tag = (XTag)i.next();
                        String columnName = tag.getAttributeValue(COLUMN_NAME_ATTR);
                        String relatedField = tag.getAttributeValue(RELATED_FIELD_ATTR);

                        extensions.add(new VendorExtension(getVendorName(), relatedField + "-ref-column", columnName));
                    }

                    Collection targetTags = relatedDoc.getTags(SQL_FIELD_TAG);

                    for (Iterator i = targetTags.iterator(); i.hasNext(); ) {
                        XTag tag = (XTag)i.next();
                        String columnName = tag.getAttributeValue(COLUMN_NAME_ATTR);
                        String relatedField = tag.getAttributeValue(RELATED_FIELD_ATTR);

                        extensions.add(new VendorExtension(getVendorName(), relatedField + "-data-column", columnName));
                    }
                }
                else {
                    LOG.warn(Translator.getString(XDocletModulesJdoMessages.class,
                        XDocletModulesJdoMessages.NOT_SUPPORTED_TAG_ATTRIBUTE_VALUE,
                        new String[]{SQL_RELATION_TAG, STYLE_ATTR, style, getVendorDescription()}));
                }
            }
            else {
                LOG.warn(Translator.getString(XDocletModulesJdoMessages.class,
                    XDocletModulesJdoMessages.NOT_SUPPORTED_TAG_ATTRIBUTE_VALUE,
                    new String[]{"jdo.field", "collection-type", collectionType, getVendorDescription()}));
            }

        }
        else if (doc.hasTag(SQL_FIELD_TAG)) {
            String tableName = doc.getTagAttributeValue(SQL_FIELD_TAG, TABLE_NAME_ATTR);
            String columnName = doc.getTagAttributeValue(SQL_FIELD_TAG, COLUMN_NAME_ATTR);

            if ("true".equals(doc.getTagAttributeValue("jdo.field", "primary-key"))) {
                XDoc classDoc = getCurrentClass().getDoc();
                String identity = classDoc.getTagAttributeValue("jdo.persistence-capable", "identity-type");

                if (identity == null || "datastore".equals(identity)) {
                    LOG.warn(Translator.getString(XDocletModulesSolarmetricMessages.class,
                        XDocletModulesSolarmetricMessages.NOT_SUPPORTED_PK_FIELD_AND_DATASTORE_IDENTITY));
                }
            }
            if (tableName != null) {
                extensions.add(new VendorExtension(getVendorName(), "table", tableName));
            }
            extensions.add(new VendorExtension(getVendorName(), "data-column", columnName));

            if (doc.hasTag("kodo.field")) {
                XTag tag = doc.getTag("kodo.field");
                String blob = tag.getAttributeValue("blob");
                String columnLength = tag.getAttributeValue("column-length");
                String columnIndex = tag.getAttributeValue("column-index");
                String ordered = tag.getAttributeValue("ordered");
                String orderColumn = tag.getAttributeValue("order-column");
                String readOnly = tag.getAttributeValue("read-only");

                if (blob != null) {
                    extensions.add(new VendorExtension(getVendorName(), "blob", blob));
                }
                if (columnLength != null) {
View Full Code Here

Examples of xjavadoc.XTag

    {
        if (super.matchesGenerationRules(clazz) == false) {
            return false;
        }

        XTag interfaceTag = clazz.getDoc().getTag(WEB_SERVLET);

        Log log = LogUtil.getLog(ServiceEndpointSubTask.class, "matchesGenerationRules");

        if (interfaceTag == null) {
            log.debug("Reject file " + clazz.getQualifiedName() + " because of not being a servlet");
View Full Code Here

Examples of xjavadoc.XTag

     * @exception XDocletException
     */
    public String getNamespaceURI(XClass clazz)
         throws XDocletException
    {
        XTag wsTag = clazz.getDoc().getTag("wsee.port-component");
        String nameSpace = null;

        if (wsTag == null) {
            wsTag = clazz.getDoc().getTag("wsee.jaxrpc-mapping");
        }
        if (wsTag != null) {
            nameSpace = wsTag.getAttributeValue("namespace-uri");
        }
        if (nameSpace == null) {
            nameSpace = getNamespaceForPackage(clazz.getContainingPackage());
        }
        return nameSpace;
View Full Code Here

Examples of xjavadoc.XTag

     */
    public String serviceEndpoint(Properties props) throws XDocletException
    {
        XClass clazz = getCurrentClass();
        String pkg = PackageTagsHandler.getPackageNameFor(clazz.getContainingPackage(), true);
        XTag ejbTag = null;
        String spec = null;

        if (clazz.getDoc().hasTag("ejb.bean")) {
            ejbTag = clazz.getDoc().getTag("ejb.interface");
            if (ejbTag != null) {
                spec = ejbTag.getAttributeValue("service-endpoint-class");
            }
            // if we haven't explicitly defined a service interface name, try to build the default name.
            if (spec == null || "".equals(spec)) {
                spec = pkg + "." + clazz.getName();
                if (spec.endsWith("Bean"))
                    spec = spec.substring(0, spec.length() - 4);
            }
        }
        else {

            ejbTag = clazz.getDoc().getTag("web.servlet");
            if (ejbTag != null) {
                spec = ejbTag.getAttributeValue("service-endpoint-class");
            }
            if (spec == null || "".equals(spec)) {
                spec = pkg + "." + clazz.getName();
                spec += "Service";
            }
View Full Code Here

Examples of xjavadoc.XTag

     */
    public String serviceEndpointLink(Properties props)
         throws XDocletException
    {
        XClass clazz = getCurrentClass();
        XTag ejbTag = clazz.getDoc().getTag("ejb.bean");

        if (ejbTag != null) {
            return "<ejb-link>" + ejbTag.getAttributeValue("name") + "</ejb-link>";
        }
        ejbTag = clazz.getDoc().getTag("web.servlet");
        if (ejbTag != null) {
            return "<servlet-link>"
                + ejbTag.getAttributeValue("name")
                + "</servlet-link>";
        }
        return null;
    }
View Full Code Here

Examples of xjavadoc.XTag

     * @return                      The StrutsFormClassName value
     * @exception XDocletException  Describe the exception
     */
    public static String getStrutsFormClassName(XClass clazz) throws XDocletException
    {
        XTag currentTag = ((StrutsFormSubTask) DocletContext.getInstance().getSubTaskBy(DocletTask.getSubTaskName(StrutsFormSubTask.class))).getCurrentFormTag();

        // check if there is a name parameter
        String name = currentTag.getAttributeValue("name");

        if (name == null) {
            return getShortEjbNameFor(clazz) + "Form";
        }
        else {
View Full Code Here

Examples of xjavadoc.XTag

     * @exception XDocletException  Description of Exception
     * @doc.tag                     type="content"
     */
    public String strutsFormName() throws XDocletException
    {
        XTag currentTag = ((StrutsFormSubTask) getDocletContext().getSubTaskBy(DocletTask.getSubTaskName(StrutsFormSubTask.class))).getCurrentFormTag();
        String formName = currentTag.getAttributeValue("name");

        if (formName == null || formName.trim().length() == 0) {
            return Introspector.decapitalize(getEjbNameFor(getCurrentClass()) + "Form");
        }
        else {
View Full Code Here

Examples of xjavadoc.XTag

     * @exception XDocletException  Description of Exception
     */
    protected boolean useMethodInForm(XMethod method) throws XDocletException
    {
        // check for include-all
        XTag currentTag = ((StrutsFormSubTask) getDocletContext().getSubTaskBy(DocletTask.getSubTaskName(StrutsFormSubTask.class))).getCurrentFormTag();
        String value = currentTag.getAttributeValue("include-all");

        // by default, include all is false
        if (value != null && value.equals("true")) {
            return true;
        }

        // include all pk fields unless include-pk="false"
        value = currentTag.getAttributeValue("include-pk");
        if (PersistentTagsHandler.isPkField(method) && (value != null && value.equals("true"))) {
            return true;
        }

        // check for explicit inclusion
        Collection mTags = method.getDoc().getTags("struts:form-field");
       
        // if there's a name on the form, then user must specify a form-name attribute
        // on the method.  This is so multiple forms can be generated from the same POJO.
        String fname = currentTag.getAttributeValue("name");

        if (fname == null && !mTags.isEmpty()) {
            return true;
        }
        else {
            for (Iterator i = mTags.iterator(); i.hasNext(); ) {
                XTag mTag = (XTag) i.next();
                String pname = mTag.getAttributeValue("form-name");

                if (pname != null && fname != null && fname.equals(pname)) {
                    return true;
                }
            }
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.