/** * Constructs an EditorAccess for an IsEditor type. */ public static EditorAccess via(EditorAccess access, JClassType type) { return new EditorAccess(access.getPath(), type, access.getExpresson() + ".asEditor()"); }
/** * Constructs an EditorAccess for an IsEditor type. */ public static EditorAccess via(EditorAccess access, JClassType type) { return new EditorAccess(access.getPath(), type, access.getExpresson() + ".asEditor()"); }
public Builder access(EditorAccess access) throws UnableToCompleteException { this.access = access; data.declaredPath = access.getPath(); data.editorType = access.getEditorType(); data.editedType = EditorModel.calculateEditedType(logger, data.editorType); data.simpleExpression = access.getExpresson(); TypeOracle oracle = data.editorType.getOracle(); JClassType leafType = oracle.findType(LeafValueEditor.class.getName()); data.isLeaf = leafType.isAssignableFrom(data.editorType); JClassType composedType = oracle.findType(CompositeEditor.class.getName()); data.isCompositeEditor = composedType.isAssignableFrom(data.editorType); JClassType hasDelegateType = oracle.findType(HasEditorDelegate.class.getName()); JClassType hasEditorErrorsType = oracle.findType(HasEditorErrors.class.getName()); data.isDelegateRequired = hasDelegateType.isAssignableFrom(data.editorType) || hasEditorErrorsType.isAssignableFrom(data.editorType) || !ModelUtils.isValueType(oracle, data.editedType); JClassType valueAwareType = oracle.findType(ValueAwareEditor.class.getName()); data.isValueAware = valueAwareType.isAssignableFrom(data.editorType); return this; }
public Builder access(EditorAccess access) throws UnableToCompleteException { this.access = access; data.declaredPath = access.getPath(); data.editorType = access.getEditorType(); data.editedType = EditorModel.calculateEditedType(logger, data.editorType); data.simpleExpression = access.getExpresson(); TypeOracle oracle = data.editorType.getOracle(); JClassType leafType = oracle.findType(LeafValueEditor.class.getName()); data.isLeaf = leafType.isAssignableFrom(data.editorType); JClassType composedType = oracle.findType(CompositeEditor.class.getName()); data.isCompositeEditor = composedType.isAssignableFrom(data.editorType); JClassType hasDelegateType = oracle.findType(HasEditorDelegate.class.getName()); JClassType hasEditorErrorsType = oracle.findType(HasEditorErrors.class.getName()); data.isDelegateRequired = hasDelegateType.isAssignableFrom(data.editorType) || hasEditorErrorsType.isAssignableFrom(data.editorType) || !ModelUtils.isValueType(oracle, data.editedType); JClassType valueAwareType = oracle.findType(ValueAwareEditor.class.getName()); data.isValueAware = valueAwareType.isAssignableFrom(data.editorType); return this; }
public EditorData build() throws UnableToCompleteException { if (data == null) { throw new IllegalStateException(); } try { data.editorExpression = (parent == null ? "" : (parent.getExpression() + ".")) + access.getExpresson(); data.path = (parent == null ? "" : (parent.getPath() + ".")) + access.getPath(); if (data.isCompositeEditor) { TreeLogger compositeLogger = logger.branch(TreeLogger.DEBUG, "Examining composite editor at " + data.path); JClassType subEditorType = EditorModel.calculateCompositeTypes(data.editorType)[1]; data.composedData = new Builder(compositeLogger).access( EditorAccess.root(subEditorType)).parent(data).build(); } return data; } finally { data = null; } }
public EditorData build() throws UnableToCompleteException { if (data == null) { throw new IllegalStateException(); } try { data.editorExpression = (parent == null ? "" : (parent.getExpression() + ".")) + access.getExpresson(); data.path = (parent == null ? "" : (parent.getPath() + ".")) + access.getPath(); if (data.isCompositeEditor) { TreeLogger compositeLogger = logger.branch(TreeLogger.DEBUG, "Examining composite editor at " + data.path); JClassType subEditorType = EditorModel.calculateCompositeTypes(data.editorType)[1]; data.composedData = new Builder(compositeLogger).access( EditorAccess.root(subEditorType)).parent(data).build(); } return data; } finally { data = null; } }