/** Returns the component definition of the dynamic tag, or null if * this language doesn't support the dynamic tag. * @exception DefinitionNotFoundException is thrown if the definition * is not found */ public ComponentDefinition getDynamicTagDefinition() { if (_dyntagDefn == null) { //no sync since racing is OK if (_dyntagnm == null) return null; _dyntagDefn = getComponentDefinition(_dyntagnm); } return _dyntagDefn; }
/** Returns the component definition of the specified class in all * language of the specified device, or null if not found * * @param deviceType the device type ({@link org.zkoss.zk.device.Device}), * such as ajax. It cannot be null. * @param cls the implementation class of the component. * @since 5.0.0 */ public static final ComponentDefinition getDefinitionByDeviceType(String deviceType, Class cls) { for (LanguageDefinition ld : LanguageDefinition.getByDeviceType(deviceType)) { try { return ld.getComponentDefinition(cls); } catch (DefinitionNotFoundException ex) { //ignore } } return null; }
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); final Object v = s.readObject(); if (v instanceof String) { final LanguageDefinition langdef = LanguageDefinition.lookup((String) v); final String name = (String) s.readObject(); try { _compdef = langdef.getComponentDefinition(name); } catch (DefinitionNotFoundException e) { // Bug ZK-1918 if ("native".equals(name)) { _compdef = langdef.getNativeDefinition(); } else { throw e; } } } else { _compdef = (ComponentDefinition) v; } }
private ComponentInfo newComponentInfo(NodeInfo parent, String text) { if (_compdef == null) //no sync since racing is OK _compdef = getComponentDefinition(_name); final ComponentInfo info = new ComponentInfo(parent, _compdef, null); info.addProperty(_prop, text, null); return info; } }
/*package*/ static ComponentDefinition getDefinitionByDeviceType(Component comp, String deviceType, String name) { for (LanguageDefinition ld : LanguageDefinition.getByDeviceType(deviceType)) { try { final ComponentDefinition def = ld.getComponentDefinition(name); if (def.isInstance(comp)) return def; } catch (DefinitionNotFoundException ex) { //ignore } } return null; }
public ComponentDefinition getComponentDefinition(Class<? extends Component> cls, boolean recurse) { final ComponentDefinition compdef = _compdefs.get(cls); if (!recurse || compdef != null) return compdef; try { return _langdef.getComponentDefinition(cls); } catch (DefinitionNotFoundException ex) { try { // try with shadow element return _langdef.getShadowDefinition(cls); } catch (DefinitionNotFoundException eex) { } } return null; }
public ComponentDefinition getComponentDefinition(String name, boolean recurse) { final ComponentDefinition compdef = _compdefs.get(name); if (!recurse || compdef != null) return compdef; try { return _langdef.getComponentDefinition(name); } catch (DefinitionNotFoundException ex) { try { // try with shadow element return _langdef.getShadowDefinition(name); } catch (DefinitionNotFoundException exe) { } } return null; }
/** Returns the component definition of the specified name, or null * if not found. * * <p>Note: unlike {@link LanguageDefinition#getComponentDefinition}, * this method doesn't throw ComponentNotFoundException if not found. * It just returns null. * * @param recurse whether to look up the component from {@link #getLanguageDefinition} */ public ComponentDefinition getComponentDefinition(String name, boolean recurse) { final ComponentDefinition compdef = _compdefs.get(name); if (!recurse || compdef != null) return compdef; try { return getLanguageDefinition().getComponentDefinition(name); } catch (DefinitionNotFoundException ex) { } return null; }
/** Returns the component definition of the specified class, or null * if not found. * * <p>Note: unlike {@link LanguageDefinition#getComponentDefinition}, * this method doesn't throw ComponentNotFoundException if not found. * It just returns null. * * @param recurse whether to look up the component from {@link #getLanguageDefinition} */ public ComponentDefinition getComponentDefinition(Class cls, boolean recurse) { final ComponentDefinition compdef = _compdefs.get(cls); if (!recurse || compdef != null) return compdef; try { return getLanguageDefinition().getComponentDefinition(cls); } catch (DefinitionNotFoundException ex) { try { // try with shadow element return getLanguageDefinition().getShadowDefinition(cls); } catch (DefinitionNotFoundException eex) { } } return null; }
ref = langdef.getComponentDefinition(extds); } else { try { final Class cls = pgdef.getImportedClassResolver().resolveClass(clsnm); if (lang != null) { ref = langdef.getComponentDefinition(cls);
.getComponentDefinition(_extends); if (ref.isMacro()) throw new UiException("Unable to extend from a macro component, "+_extends);
compInfo = new ComponentInfo(parent, compdef, nm); } else if (complangdef.hasComponentDefinition(nm)) { compdef = complangdef.getComponentDefinition(nm); compInfo = new ComponentInfo(parent, compdef, nm); langdef = complangdef;