/** * PUBLIC: * Sets the name of the attribute in the mapping. */ @Override public void setAttributeName(String attributeName) { getAttributeAccessor().setAttributeName(attributeName); // Clear the mapping attribute name until a getAttributeName() call copies the accessor attributeName this.attributeName = null; }
/** * PUBLIC: * Sets the name of the attribute in the mapping. */ public void setAttributeName(String attributeName) { getAttributeAccessor().setAttributeName(attributeName); // Clear the mapping attribute name until a getAttributeName() call copies the accessor attributeName this.attributeName = null; }
/** * PUBLIC: * Sets the name of the attribute in the mapping. */ @Override public void setAttributeName(String attributeName) { getAttributeAccessor().setAttributeName(attributeName); // Clear the mapping attribute name until a getAttributeName() call copies the accessor attributeName this.attributeName = null; }
/** * Sets the name of the backpointer attribute on the target object. Used to * populate the backpointer. If the specified attribute doesn't exist on * the reference class of this mapping, a DescriptorException will be thrown * during initialize. * * @param attributeName - the name of the backpointer attribute to be populated */ public void setBidirectionalTargetAttributeName(String attributeName) { if(attributeName != null) { if(this.bidirectionalTargetAccessor == null) { this.bidirectionalTargetAccessor = new InstanceVariableAttributeAccessor(); } this.getBidirectionalTargetAccessor().setAttributeName(attributeName); } }
/** * Sets the name of the backpointer attribute on the target object. Used to * populate the backpointer. If the specified attribute doesn't exist on * the reference class of this mapping, a DescriptorException will be thrown * during initialize. * * @param attributeName - the name of the backpointer attribute to be populated */ public void setBidirectionalTargetAttributeName(String attributeName) { if(attributeName != null) { if(this.bidirectionalTargetAccessor == null) { this.bidirectionalTargetAccessor = new InstanceVariableAttributeAccessor(); } this.getBidirectionalTargetAccessor().setAttributeName(attributeName); } }
/** * ADVANCED: * Set the attributeAccessor. * The attribute accessor is responsible for setting and retrieving the attribute value * from the object for this mapping. * This can be set to an implementor of AttributeAccessor if the attribute * requires advanced conversion of the mapping value, or a real attribute does not exist. */ public void setAttributeAccessor(AttributeAccessor attributeAccessor) { String attributeName = getAttributeName(); this.attributeAccessor = attributeAccessor; if (attributeAccessor.getAttributeName() == null) { attributeAccessor.setAttributeName(attributeName); } this.attributeName = null; }
/** * ADVANCED: * Set the attributeAccessor. * The attribute accessor is responsible for setting and retrieving the attribute value * from the object for this mapping. * This can be set to an implementor of AttributeAccessor if the attribute * requires advanced conversion of the mapping value, or a real attribute does not exist. */ @Override public void setAttributeAccessor(AttributeAccessor attributeAccessor) { String attributeName = getAttributeName(); this.attributeAccessor = attributeAccessor; if (attributeAccessor.getAttributeName() == null) { attributeAccessor.setAttributeName(attributeName); } this.attributeName = null; }
/** * Sets the name of the backpointer attribute on the target object. Used to * populate the backpointer. If the specified attribute doesn't exist on * the reference class of this mapping, a DescriptorException will be thrown * during initialize. * * @param attributeName - the name of the backpointer attribute to be populated */ public void setBidirectionalTargetAttributeName(String attributeName) { if(attributeName != null) { if(this.bidirectionalTargetAccessor == null) { this.bidirectionalTargetAccessor = new InstanceVariableAttributeAccessor(); } this.getBidirectionalTargetAccessor().setAttributeName(attributeName); } }
/** * ADVANCED: * Set the attributeAccessor. * The attribute accessor is responsible for setting and retrieving the attribute value * from the object for this mapping. * This can be set to an implementor of AttributeAccessor if the attribute * requires advanced conversion of the mapping value, or a real attribute does not exist. */ @Override public void setAttributeAccessor(AttributeAccessor attributeAccessor) { String attributeName = getAttributeName(); this.attributeAccessor = attributeAccessor; if (attributeAccessor.getAttributeName() == null) { attributeAccessor.setAttributeName(attributeName); } this.attributeName = null; }
public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if(variableAttributeAccessor == null){ if(variableAttributeName != null){ this.variableAttributeAccessor = new InstanceVariableAttributeAccessor(); this.variableAttributeAccessor.setAttributeName(variableAttributeName); }else if(variableGetMethodName != null){ this.variableAttributeAccessor = new MethodAttributeAccessor(); this.variableAttributeAccessor.setAttributeName("VARIABLE"); ((MethodAttributeAccessor)this.variableAttributeAccessor).setGetMethodName(variableGetMethodName); if(variableSetMethodName == null){ this.variableAttributeAccessor.setIsWriteOnly(true); }else{ ((MethodAttributeAccessor)this.variableAttributeAccessor).setSetMethodName(variableSetMethodName); } } } this.variableAttributeAccessor.initializeAttributes(this.getReferenceClass()); }
public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if(variableAttributeAccessor == null){ if(variableAttributeName != null){ this.variableAttributeAccessor = new InstanceVariableAttributeAccessor(); this.variableAttributeAccessor.setAttributeName(variableAttributeName); }else if(variableGetMethodName != null){ this.variableAttributeAccessor = new MethodAttributeAccessor(); this.variableAttributeAccessor.setAttributeName("VARIABLE"); ((MethodAttributeAccessor)this.variableAttributeAccessor).setGetMethodName(variableGetMethodName); if(variableSetMethodName == null){ this.variableAttributeAccessor.setIsWriteOnly(true); }else{ ((MethodAttributeAccessor)this.variableAttributeAccessor).setSetMethodName(variableSetMethodName); } } } this.variableAttributeAccessor.initializeAttributes(this.getReferenceClass()); }
/** * PUBLIC: * This method is invoked reflectively on the reference object to return the value of the * attribute in the object. This method sets the name of the getMethodName. */ public void setGetMethodName(String methodName) { if (methodName == null) { return; } // This is done because setting attribute name by defaults create InstanceVariableAttributeAccessor if (getAttributeAccessor() instanceof InstanceVariableAttributeAccessor) { String attributeName = this.attributeAccessor.getAttributeName(); setAttributeAccessor(new MethodAttributeAccessor()); getAttributeAccessor().setAttributeName(attributeName); } ((MethodAttributeAccessor)getAttributeAccessor()).setGetMethodName(methodName); }
/** * PUBLIC: * This method is invoked reflectively on the reference object to return the value of the * attribute in the object. This method sets the name of the getMethodName. */ public void setGetMethodName(String methodName) { if (methodName == null) { return; } // This is done because setting attribute name by defaults create InstanceVariableAttributeAccessor if (getAttributeAccessor() instanceof InstanceVariableAttributeAccessor) { String attributeName = this.attributeAccessor.getAttributeName(); setAttributeAccessor(new MethodAttributeAccessor()); getAttributeAccessor().setAttributeName(attributeName); } ((MethodAttributeAccessor)getAttributeAccessor()).setGetMethodName(methodName); }
/** * PUBLIC: * This method is invoked reflectively on the reference object to return the value of the * attribute in the object. This method sets the name of the getMethodName. */ public void setGetMethodName(String methodName) { if (methodName == null) { return; } // This is done because setting attribute name by defaults create InstanceVariableAttributeAccessor if (getAttributeAccessor() instanceof InstanceVariableAttributeAccessor) { String attributeName = this.attributeAccessor.getAttributeName(); setAttributeAccessor(new MethodAttributeAccessor()); getAttributeAccessor().setAttributeName(attributeName); } ((MethodAttributeAccessor)getAttributeAccessor()).setGetMethodName(methodName); }
/** * PUBLIC: * Set the methodName used to set the value for the mapping's attribute into the object. */ public void setSetMethodName(String methodName) { if (methodName == null) { return; } // This is done because setting attribute name by defaults create InstanceVariableAttributeAccessor if (!getAttributeAccessor().isMethodAttributeAccessor()) { String attributeName = this.attributeAccessor.getAttributeName(); setAttributeAccessor(new MethodAttributeAccessor()); getAttributeAccessor().setAttributeName(attributeName); } ((MethodAttributeAccessor)getAttributeAccessor()).setSetMethodName(methodName); }
/** * PUBLIC: * Set the methodName used to set the value for the mapping's attribute into the object. */ public void setSetMethodName(String methodName) { if (methodName == null) { return; } // This is done because setting attribute name by defaults create InstanceVariableAttributeAccessor if (!getAttributeAccessor().isMethodAttributeAccessor()) { String attributeName = this.attributeAccessor.getAttributeName(); setAttributeAccessor(new MethodAttributeAccessor()); getAttributeAccessor().setAttributeName(attributeName); } ((MethodAttributeAccessor)getAttributeAccessor()).setSetMethodName(methodName); }
/** * PUBLIC: * Set the methodName used to set the value for the mapping's attribute into the object. */ public void setSetMethodName(String methodName) { if (methodName == null) { return; } // This is done because setting attribute name by defaults create InstanceVariableAttributeAccessor if (!getAttributeAccessor().isMethodAttributeAccessor()) { String attributeName = this.attributeAccessor.getAttributeName(); setAttributeAccessor(new MethodAttributeAccessor()); getAttributeAccessor().setAttributeName(attributeName); } ((MethodAttributeAccessor)getAttributeAccessor()).setSetMethodName(methodName); }
/** * Sets the method name to be used when accessing the value of the back pointer * on the target object of this mapping. If the specified method doesn't exist * on the reference class of this mapping, a DescriptorException will be thrown * during initialize. * * @param methodName - the getter method to be used. */ public void setBidirectionalTargetGetMethodName(String methodName) { if (methodName == null) { return; } if(this.bidirectionalTargetAccessor == null) { bidirectionalTargetAccessor = new MethodAttributeAccessor(); } // This is done because setting attribute name by defaults create InstanceVariableAttributeAccessor if (!getBidirectionalTargetAccessor().isMethodAttributeAccessor()) { String attributeName = this.bidirectionalTargetAccessor.getAttributeName(); setBidirectionalTargetAccessor(new MethodAttributeAccessor()); getBidirectionalTargetAccessor().setAttributeName(attributeName); } ((MethodAttributeAccessor)getBidirectionalTargetAccessor()).setGetMethodName(methodName); }
/** * Sets the name of the method to be used when setting the value of the back pointer * on the target object of this mapping. If the specified method doesn't exist * on the reference class of this mapping, a DescriptorException will be thrown * during initialize. * * @param methodName - the setter method to be used. */ public void setBidirectionalTargetSetMethodName(String methodName) { if (methodName == null) { return; } if(this.bidirectionalTargetAccessor == null) { this.bidirectionalTargetAccessor = new MethodAttributeAccessor(); } // This is done because setting attribute name by defaults create InstanceVariableAttributeAccessor if (!getBidirectionalTargetAccessor().isMethodAttributeAccessor()) { String attributeName = this.bidirectionalTargetAccessor.getAttributeName(); setBidirectionalTargetAccessor(new MethodAttributeAccessor()); getBidirectionalTargetAccessor().setAttributeName(attributeName); } ((MethodAttributeAccessor)getBidirectionalTargetAccessor()).setSetMethodName(methodName); }
/** * Sets the method name to be used when accessing the value of the back pointer * on the target object of this mapping. If the specified method doesn't exist * on the reference class of this mapping, a DescriptorException will be thrown * during initialize. * * @param methodName - the getter method to be used. */ public void setBidirectionalTargetGetMethodName(String methodName) { if (methodName == null) { return; } if(this.bidirectionalTargetAccessor == null) { bidirectionalTargetAccessor = new MethodAttributeAccessor(); } // This is done because setting attribute name by defaults create InstanceVariableAttributeAccessor if (!getBidirectionalTargetAccessor().isMethodAttributeAccessor()) { String attributeName = this.bidirectionalTargetAccessor.getAttributeName(); setBidirectionalTargetAccessor(new MethodAttributeAccessor()); getBidirectionalTargetAccessor().setAttributeName(attributeName); } ((MethodAttributeAccessor)getBidirectionalTargetAccessor()).setGetMethodName(methodName); }