All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.enhydra.xml.xmlc.metadata.ElementDef Maven / Gradle / Ivy

The newest version!
/*
 * Enhydra Java Application Server Project
 * 
 * The contents of this file are subject to the Enhydra Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License on
 * the Enhydra web site ( http://www.enhydra.org/ ).
 * 
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 
 * the License for the specific terms governing rights and limitations
 * under the License.
 * 
 * The Initial Developer of the Enhydra Application Server is Lutris
 * Technologies, Inc. The Enhydra Application Server and portions created
 * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
 * All Rights Reserved.
 * 
 * Contributor(s):
 * 
 * $Id: ElementDef.java,v 1.2 2005/01/26 08:29:24 jkjome Exp $
 */

package org.enhydra.xml.xmlc.metadata;

import org.w3c.dom.Document;

/**
 * Define a particular element in the document.  An <elementDef>
 * uniquely address a particular element in the document.
 */
public class ElementDef extends MetaDataElement {
    /**
     * Element name.
     */
    public static final String TAG_NAME = "elementDef";

    /**
     * Attribute names.
     */
    private static final String ELEMENT_ID_ATTR = "elementId";
    private static final String TAG_NAMES_ATTR = "tagNames";
    private static final String DOM_TYPE_ATTR = "domType";
    private static final String JAVA_NAME_ATTR = "javaName";
    private static final String CREATE_SETTEXT_ATTR = "createSetText";
    private static final String CREATE_GETELEMENT_ATTR = "createGetElement";
    private static final String OPTIONAL_ATTR = "optional";

    /**
     * Constructor.
     */
    public ElementDef(Document ownerDoc) {
    	super(ownerDoc, TAG_NAME);
    }

    /**
     * Get the elementId attribute value.
     */
    public String getElementId() {
        return getAttributeNull(ELEMENT_ID_ATTR);
    }

    /**
     * Set the elementId attribute value.
     */
    public void setElementId(String value) {
        setRemoveAttribute(ELEMENT_ID_ATTR, value);
    }

    /**
     * Get the tagNames attribute value.
     */
    public String[] getTagNames() {
        return getStringArrayAttribute(TAG_NAMES_ATTR);
    }

    /**
     * Set the tagNames attribute value.
     */
    public void setTagNames(String[] values) {
        setRemoveStringArrayAttribute(TAG_NAMES_ATTR, values);
    }

    /**
     * Get the domType attribute value.
     */
    public String getDomType() {
        return getAttributeNull(DOM_TYPE_ATTR);
    }

    /**
     * Set the domType attribute value.
     */
    public void setDomType(String value) {
        setRemoveAttribute(DOM_TYPE_ATTR, value);
    }

    /**
     * Get the javaName attribute value.
     */
    public String getJavaName() {
        return getAttributeNull(JAVA_NAME_ATTR);
    }

    /**
     * Set the javaName attribute value.
     */
    public void setJavaName(String value) {
        setRemoveAttribute(JAVA_NAME_ATTR, value);
    }

    /**
     * Get the createSetText attribute value.
     */
    public Boolean getCreateSetText() {
        return getBooleanObjectAttribute(CREATE_SETTEXT_ATTR);
    }

    /**
     * Set the createSetText attribute value.
     */
    public void setCreateSetText(Boolean value) {
        setBooleanObjectAttribute(CREATE_SETTEXT_ATTR, value);
    }

    /**
     * Get the createGetElement attribute value.
     */
    public Boolean getCreateGetElement() {
        return getBooleanObjectAttribute(CREATE_GETELEMENT_ATTR);
    }

    /**
     * Set the createGetElement attribute value.
     */
    public void setCreateGetElement(Boolean value) {
        setBooleanObjectAttribute(CREATE_GETELEMENT_ATTR, value);
    }

    /**
     * Get the optional attribute value.
     */
    public boolean getOptional() {
        return getBooleanAttribute(OPTIONAL_ATTR);
    }

    /**
     * Set the optional attribute value.
     */
    public void setOptional(boolean value) {
        setBooleanAttribute(OPTIONAL_ATTR, value);
    }

    /**
     * Get the ElementDef child elements.
     */
    public ElementDef[] getElementDef() {
        return (ElementDef[])getChildren(ElementDef.class);
    }

    /**
     * Add a ElementDef child element.
     */
    public void addElementDef(ElementDef elementDef) {
        appendChild(elementDef);
    }

    /**
     * Delete a ElementDef child element.
     */
    public void deleteElementDef(ElementDef elementDef) {
        removeChild(elementDef);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy