|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.unreal.t3dgenerator.AbstractT3dGenerator
cz.cuni.amis.pogamut.unreal.t3dgenerator.DefaultT3dGenerator
public class DefaultT3dGenerator
Default implementation of IT3dGenerator. Reads annotations
from package cz.cuni.amis.pogamut.unreal.t3dgenerator.annotations present
on classes that are to be serialized. Every unannotated, non-static, non-transient
member of a serialized object is treated as a property of this object.
Objects that are descendants of IUnrealReferencableByName and have
no name specified get their names autogenerated.
Properties and child objects with null values are not exported (so that defaults from archetype are applied in editor).
| Constructor Summary | |
|---|---|
DefaultT3dGenerator()
|
|
| Method Summary | |
|---|---|
protected void |
generateHeaderProperties(Object object,
OutputStreamWriter out)
Generates a single line string of header properties of an object to an OutputStreamWriter. |
protected void |
generateProperties(Object object,
OutputStreamWriter out,
int indent)
Generates properties of an object to an OutputStreamWriter. |
protected void |
generateProperty(OutputStreamWriter out,
String indentString,
String propertyName,
Object propertyValue)
Generates a text for specified property to an OutputStreamWriter. |
protected void |
generateStaticText(Object object,
OutputStreamWriter out,
int indent)
Gathers all static text properties of an object and outputs them to a specified OutputStreamWriter |
void |
generateT3d(List elements,
OutputStreamWriter out)
Creates T3D for all specified objects. |
protected void |
generateT3dFromDynamicObject(DynamicT3DObject object,
OutputStreamWriter out,
int indent)
|
protected void |
generateT3dInternal(Object object,
OutputStreamWriter out,
int indent)
Generates T3D for an object and all it's child objects. |
protected List<Object> |
getChildren(Object unrealObject)
Gets a list of all child objects of a specified object. |
protected String |
getElementType(Object unrealObject)
Gets an element type (e.g. |
protected Map<String,Object> |
getProperties(Object object)
Gets a map of properties of an object. |
protected String |
getPropertyNameForField(Field f,
String annotationValue)
Returns a name for property in a field. |
protected String |
getPropertyString(String key,
Object value)
Returns a string for property with name Unreal name key and specified value. |
protected String |
getPropertyString(String key,
Object value,
boolean escapeStrings)
Returns a string for property with name Unreal name key and specified value. |
protected String |
getPropertyValueString(Object value)
Transforms a value of a property into it's string representation, strings are escaped with single quote. |
protected String |
getPropertyValueString(Object value,
boolean escapeStrings)
Transforms a value of a property into it's string representation. |
String |
getTranslatedName(Field f)
Translates a name of a field from Java naming convention to UDK naming convention. |
protected static String |
indentString(int indent)
Create a string of tabs... |
protected void |
preProcess(Object unrealObject,
IT3dGeneratorContext context)
Preprocesses an object before serializing it. |
| Methods inherited from class cz.cuni.amis.pogamut.unreal.t3dgenerator.AbstractT3dGenerator |
|---|
generateT3d |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultT3dGenerator()
| Method Detail |
|---|
protected static String indentString(int indent)
indent -
protected String getPropertyNameForField(Field f,
String annotationValue)
f - annotationValue - the name specified in annotation or null/empty string if there is not any
public String getTranslatedName(Field f)
f -
protected void preProcess(Object unrealObject,
IT3dGeneratorContext context)
IUnrealReferencableByName
and does not have a name.
unrealObject - context -
protected String getPropertyValueString(Object value,
boolean escapeStrings)
value - escapeStrings - true, if strings should be escaped with single quote. Should be false for header fields.
protected String getPropertyValueString(Object value)
value -
protected String getPropertyString(String key,
Object value,
boolean escapeStrings)
key - value - escapeStrings - true, if strings should be escaped with single quote. Should be false for header fields.
protected String getPropertyString(String key,
Object value)
key - value -
protected void generateProperty(OutputStreamWriter out,
String indentString,
String propertyName,
Object propertyValue)
throws IOException
out - indentString - String of tabs that should be prepended to the property string.propertyName - propertyValue -
IOExceptionprotected Map<String,Object> getProperties(Object object)
object -
UnrealProperty
protected void generateProperties(Object object,
OutputStreamWriter out,
int indent)
throws IOException
object - out - indent -
IOException
protected void generateHeaderProperties(Object object,
OutputStreamWriter out)
throws IOException
IOExceptionUnrealHeaderFieldprotected List<Object> getChildren(Object unrealObject)
unrealObject -
UnrealChild,
UnrealChildCollection
protected void generateStaticText(Object object,
OutputStreamWriter out,
int indent)
throws IOException
object - out - indent -
IOExceptionStaticTextprotected String getElementType(Object unrealObject)
unrealObject -
UnrealBean
protected void generateT3dFromDynamicObject(DynamicT3DObject object,
OutputStreamWriter out,
int indent)
throws IOException
IOException
protected void generateT3dInternal(Object object,
OutputStreamWriter out,
int indent)
throws IOException
object - out - indent -
IOException
public void generateT3d(List elements,
OutputStreamWriter out)
throws IOException
elements - out -
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||