// ---------------------------------------------------------------------------
// dark-matter-data
// Copyright (c) 2010 dark-matter-data committers
// ---------------------------------------------------------------------------
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
// more details.
// You should have received a copy of the GNU Lesser General Public License along
// with this program; if not, see <http://www.gnu.org/licenses/lgpl.html>.
// ---------------------------------------------------------------------------
package org.dmd.dmg.generated.types;
import org.dmd.dmc.DmcAttributeInfo;
import org.dmd.dmc.DmcValueException;
import org.dmd.dmc.DmcOutputStreamIF;
import org.dmd.dmc.DmcInputStreamIF;
import org.dmd.dmc.types.DmcTypeNamedObjectREF;
import org.dmd.dmc.types.StringName;
import org.dmd.dmg.generated.types.MethodGeneratorREF;
import org.dmd.dmg.generated.dmo.MethodGeneratorDMO;
/**
* This is the generated DmcAttribute derivative for values of type MethodGenerator
* <P>
* Generated from the dmg schema at version 0.1
* <P>
* This code was auto-generated by the dmogenerator utility and shouldn't be alterred manually!
* Generated from: org.dmd.dms.util.DmoTypeFormatter.dumpNamedREFHelperType(DmoTypeFormatter.java:585)
*/
@SuppressWarnings("serial")
abstract public class DmcTypeMethodGeneratorREF extends DmcTypeNamedObjectREF<MethodGeneratorREF, StringName> {
public DmcTypeMethodGeneratorREF(){
}
public DmcTypeMethodGeneratorREF(DmcAttributeInfo ai){
super(ai);
}
@Override
protected MethodGeneratorREF getNewHelper(){
return(new MethodGeneratorREF());
}
@Override
protected StringName getNewName(){
return(new StringName());
}
@Override
protected String getDMOClassName(){
return( MethodGeneratorDMO.class.getName());
}
@Override
protected boolean isDMO(Object value){
if (value instanceof MethodGeneratorDMO)
return(true);
return(false);
}
@Override
protected MethodGeneratorREF typeCheck(Object value) throws DmcValueException {
MethodGeneratorREF rc = null;
if (value instanceof MethodGeneratorREF)
rc = (MethodGeneratorREF)value;
else if (value instanceof MethodGeneratorDMO)
rc = new MethodGeneratorREF((MethodGeneratorDMO)value);
else if (value instanceof StringName)
rc = new MethodGeneratorREF((StringName)value);
else if (value instanceof String)
rc = new MethodGeneratorREF((String)value);
else
throw(new DmcValueException("Object of class: " + value.getClass().getName() + " passed where object compatible with MethodGeneratorREF, MethodGeneratorDMO or String expected."));
return(rc);
}
@Override
public void serializeValue(DmcOutputStreamIF dos, MethodGeneratorREF value) throws Exception {
value.serializeIt(dos);
}
@Override
public MethodGeneratorREF deserializeValue(DmcInputStreamIF dis) throws Exception {
MethodGeneratorREF rc = new MethodGeneratorREF();
rc.deserializeIt(dis);
return(rc);
}
@Override
public MethodGeneratorREF cloneValue(MethodGeneratorREF value){
return(new MethodGeneratorREF(value));
}
}