/** * Enqueue a type in {@link #toCalculate} if {@link #peers} does not already * contain an entry. */ private void maybeCalculate(JClassType type) { if (type.isInterface() == null || ModelUtils.isValueType(oracle, type)) { return; } if (!peers.containsKey(type)) { toCalculate.add(type); } }
/** * Enqueue a type in {@link #toCalculate} if {@link #peers} does not already * contain an entry. */ private void maybeCalculate(JClassType type) { if (type.isInterface() == null || ModelUtils.isValueType(oracle, type)) { return; } if (!peers.containsKey(type)) { toCalculate.add(type); } }
/** * Enqueue a type in {@link #toCalculate} if {@link #peers} does not already * contain an entry. */ private void maybeCalculate(JClassType type) { if (type.isInterface() == null || ModelUtils.isValueType(oracle, type)) { return; } if (!peers.containsKey(type)) { toCalculate.add(type); } }
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 void setMethod(JMethod method) { toReturn.method = method; TypeOracle oracle = method.getEnclosingType().getOracle(); JType returnType = method.getReturnType(); toReturn.isValueType = ModelUtils.isValueType(oracle, returnType); if (!toReturn.isValueType) { // See if it's a collection or a map JClassType returnClass = returnType.isClassOrInterface(); JClassType collectionInterface = oracle.findType(Collection.class.getCanonicalName()); JClassType mapInterface = oracle.findType(Map.class.getCanonicalName()); if (collectionInterface.isAssignableFrom(returnClass)) { JClassType[] parameterizations = ModelUtils.findParameterizationOf( collectionInterface, returnClass); toReturn.elementType = parameterizations[0]; maybeProcessEnumType(toReturn.elementType); } else if (mapInterface.isAssignableFrom(returnClass)) { JClassType[] parameterizations = ModelUtils.findParameterizationOf( mapInterface, returnClass); toReturn.keyType = parameterizations[0]; toReturn.valueType = parameterizations[1]; maybeProcessEnumType(toReturn.keyType); maybeProcessEnumType(toReturn.valueType); } } else { maybeProcessEnumType(returnType); } }
public void setMethod(JMethod method) { toReturn.method = method; TypeOracle oracle = method.getEnclosingType().getOracle(); JType returnType = method.getReturnType(); toReturn.isValueType = ModelUtils.isValueType(oracle, returnType); if (!toReturn.isValueType) { // See if it's a collection or a map JClassType returnClass = returnType.isClassOrInterface(); JClassType collectionInterface = oracle.findType(Collection.class.getCanonicalName()); JClassType mapInterface = oracle.findType(Map.class.getCanonicalName()); if (collectionInterface.isAssignableFrom(returnClass)) { JClassType[] parameterizations = ModelUtils.findParameterizationOf( collectionInterface, returnClass); toReturn.elementType = parameterizations[0]; maybeProcessEnumType(toReturn.elementType); } else if (mapInterface.isAssignableFrom(returnClass)) { JClassType[] parameterizations = ModelUtils.findParameterizationOf( mapInterface, returnClass); toReturn.keyType = parameterizations[0]; toReturn.valueType = parameterizations[1]; maybeProcessEnumType(toReturn.keyType); maybeProcessEnumType(toReturn.valueType); } } else { maybeProcessEnumType(returnType); } }
public void setMethod(JMethod method) { toReturn.method = method; TypeOracle oracle = method.getEnclosingType().getOracle(); JType returnType = method.getReturnType(); toReturn.isValueType = ModelUtils.isValueType(oracle, returnType); if (!toReturn.isValueType) { // See if it's a collection or a map JClassType returnClass = returnType.isClassOrInterface(); JClassType collectionInterface = oracle.findType(Collection.class.getCanonicalName()); JClassType mapInterface = oracle.findType(Map.class.getCanonicalName()); if (collectionInterface.isAssignableFrom(returnClass)) { JClassType[] parameterizations = ModelUtils.findParameterizationOf( collectionInterface, returnClass); toReturn.elementType = parameterizations[0]; maybeProcessEnumType(toReturn.elementType); } else if (mapInterface.isAssignableFrom(returnClass)) { JClassType[] parameterizations = ModelUtils.findParameterizationOf( mapInterface, returnClass); toReturn.keyType = parameterizations[0]; toReturn.valueType = parameterizations[1]; maybeProcessEnumType(toReturn.keyType); maybeProcessEnumType(toReturn.valueType); } } else { maybeProcessEnumType(returnType); } }
if (ModelUtils.isValueType(oracle, transportedClass) || splittableType.equals(transportedClass)) {
if (ModelUtils.isValueType(oracle, transportedClass) || splittableType.equals(transportedClass)) {