Class ComponentDefinitionImpl

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAnnotation​(java.lang.String propName, java.lang.String annotName, java.util.Map<java.lang.String,​java.lang.String[]> annotAttrs, Location loc)
      Adds an annotation to the specified property of this component definition.
      void addCustomAttribute​(java.lang.String name, java.lang.String value)
      Adds a custom attribute.
      void addMold​(java.lang.String name, java.lang.String widgetClass)
      Adds a mold.
      void addProperty​(java.lang.String name, java.lang.String value)
      Adds a property initializer.
      void applyAttributes​(Component comp)
      Applies the custom attributes defined in this definition to the specified component.
      void applyProperties​(Component comp)
      Applies the properties defined in this definition to the specified component.
      java.lang.Object clone()
      Clones this component definition.
      ComponentDefinition clone​(LanguageDefinition langdef, java.lang.String name)
      Clones this definition and assigns with the specified language definition and name.
      java.util.Map<java.lang.String,​java.lang.Object> evalProperties​(java.util.Map<java.lang.String,​java.lang.Object> propmap, Page owner, Component parent)
      Evaluates and retrieves properties to the specified map.
      AnnotationMap getAnnotationMap()
      Returns the annotation map defined in this definition, or null if no annotation is ever defined.
      java.lang.String getApply()
      Returns the apply attribute that is a list of Composer class names or EL expressions returning classes, class names or composer instances, or null if no apply attribute.
      java.lang.String getCurrentDirectory()
      Returns the current directory which is used to convert a relative URI to absolute, or null if not available.
      java.net.URL getDeclarationURL()
      Returns the URL where this component definition is declared, or null if not available.
      java.lang.String getDefaultWidgetClass​(Component comp)
      Returns the default widget class, or null if not available.
      java.lang.Object getImplementationClass()
      Returns the class (Class) or the class name (String) that implements the component.
      LanguageDefinition getLanguageDefinition()
      Returns the language definition, or null if it is a temporary definition belonging to a page.
      java.lang.String getMacroURI()
      Returns the macro URI, or null if not a macro.
      java.util.Collection<java.lang.String> getMoldNames()
      Returns a readonly collection of the names of the mold.
      java.lang.String getName()
      Returns name of this component definition (never null).
      ExValue[] getParsedApply()
      Return the parsed expressions of the apply attribute.
      java.lang.String getTextAs()
      Returns the property name to which the text enclosed within the element (associated with this component definition) is assigned to.
      java.lang.String getWidgetClass​(Component comp, java.lang.String moldName)
      Returns the widget class associated with specified mold, or the default widget class (ComponentDefinition.getWidgetClass(org.zkoss.zk.ui.Component, java.lang.String)) if not available.
      boolean hasMold​(java.lang.String name)
      Returns whether the specified mold exists.
      boolean isBlankPreserved()
      Returns whether to preserve the blank text.
      boolean isChildAllowedInTextAs()
      Returns if a child is allowed in the text-as area.
      boolean isInlineMacro()
      Returns whether this is an inline macro.
      boolean isInstance​(Component comp)
      Returns whether a component belongs to this definition.
      boolean isMacro()
      Returns whether this is a macro component.
      boolean isNative()
      Returns whether this is used for the native namespace.
      boolean isShadowElement()
      Returns whether this is a shadow element.
      Component newInstance​(java.lang.Class<? extends Component> cls)
      Creates an component of this definition.
      Component newInstance​(Page page, java.lang.String clsnm)
      Creates an component of this definition.
      static ComponentDefinition newMacroDefinition​(LanguageDefinition langdef, PageDefinition pgdef, java.lang.String name, java.lang.Class<? extends Component> cls, java.lang.String macroURI, boolean inline)
      Constructs a macro component definition.
      static ComponentDefinition newNativeDefinition​(LanguageDefinition langdef, java.lang.String name, java.lang.Class<? extends Component> cls)
      Constructs a native component definition.
      static ComponentDefinition newShadowDefinition​(LanguageDefinition langdef, PageDefinition pgdef, java.lang.String name, java.lang.Class<? extends Component> cls, java.lang.String templateURI)
      Constructs a shadow component definition.
      java.lang.Class<?> resolveImplementationClass​(Page page, java.lang.String clsnm)
      Resolves and returns the class that implements the component.
      void setApply​(java.lang.String apply)
      Sets the apply attribute that is is a list of Composer class or EL expressions returning classes, class names or composer instances.
      void setBlankPreserved​(boolean preserve)
      Sets whether to preserve the blank text.
      void setChildAllowedInTextAs​(boolean allowed)
      Sets whether the child component is allowed within the element.
      void setCurrentDirectory​(java.lang.String curdir)
      Sets the current directory which is used to convert a relative URI to absolute.
      void setDeclarationURL​(java.net.URL url)
      Sets the URI where this definition is declared.
      void setDefaultWidgetClass​(java.lang.String widgetClass)
      Sets the default widget class.
      void setImplementationClass​(java.lang.Class<? extends Component> cls)
      Sets the class to implements the component.
      void setImplementationClass​(java.lang.String clsnm)
      Sets the class name to implements the component.
      void setTextAs​(java.lang.String propnm)
      Sets the property name to which the text enclosed within the element (associated with this component definition) is assigned to.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ComponentDefinitionImpl

        public ComponentDefinitionImpl​(LanguageDefinition langdef,
                                       PageDefinition pgdef,
                                       java.lang.String name,
                                       java.lang.Class<? extends Component> cls)
        Constructs a native component, i.e., a component implemented by a Java class.

        Note; if both langdef and pgdef are null, it must be a reserved component.

        Parameters:
        langdef - the language definition. It is null if it is defined as part of a page definition
        pgdef - the page definition. It is null if it is defined as part of a language definition. doesn't belong to any language.
        cls - the implementation class.
        Since:
        3.0.0
      • ComponentDefinitionImpl

        public ComponentDefinitionImpl​(LanguageDefinition langdef,
                                       PageDefinition pgdef,
                                       java.lang.String name,
                                       java.lang.String clsnm)
        Constructs a native component, i.e., a component implemented by a Java class.

        Note; if both langdef and pgdef are null, it must be a reserved component.

        Parameters:
        langdef - the language definition. It is null if it is defined as part of a page definition
        pgdef - the page definition. It is null if it is defined as part of a language definition. doesn't belong to any language.
        clsnm - the implementation class.
        Since:
        3.0.8