/* * Decompiled with CFR 0.152. */ package com.tridium.sys.schema; import com.tridium.sys.schema.NSlot; import javax.baja.sys.Action; import javax.baja.sys.BFacets; import javax.baja.sys.BValue; import javax.baja.sys.Property; import javax.baja.sys.Sys; import javax.baja.sys.Topic; import javax.baja.sys.Type; public class NAction extends NSlot implements Action { Class parameterClass; Class returnClass; Type parameterType; Type returnType; BValue parameterDefault; boolean doTakesContext; public final boolean isProperty() { return false; } public final boolean isAction() { return true; } public final boolean isTopic() { return false; } public final Property asProperty() { throw new ClassCastException(); } public final Action asAction() { return this; } public final Topic asTopic() { throw new ClassCastException(); } public final Type getParameterType() { if (this.parameterClass == null) { return null; } if (this.parameterType == null) { this.parameterType = Sys.getType(this.parameterClass); } return this.parameterType; } public final BValue getParameterDefault() { if (this.parameterDefault == null) { return null; } return this.parameterDefault.newCopy(); } public final Type getReturnType() { if (this.returnClass == null) { return null; } if (this.returnType == null) { this.returnType = Sys.getType(this.returnClass); } return this.returnType; } public String toString() { return NAction.toString(this); } void copyFrom(NSlot nSlot) { super.copyFrom(nSlot); NAction nAction = (NAction)nSlot; this.parameterClass = nAction.parameterClass; this.parameterType = nAction.parameterType; this.returnClass = nAction.returnClass; this.returnType = nAction.returnType; } static String toString(Action action) { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append(action.getName()); stringBuffer.append('('); try { if (action.getParameterType() != null) { stringBuffer.append(action.getParameterType()); } } catch (Exception exception) { stringBuffer.append(exception); } stringBuffer.append(')'); return stringBuffer.toString(); } public NAction(int n, BValue bValue, BFacets bFacets) { super(null, n, bFacets, true); this.parameterDefault = bValue; } }