de.interactive_instruments.ShapeChange.Target.JSON
Class JsonSchema

java.lang.Object
  extended by de.interactive_instruments.ShapeChange.Target.JSON.JsonSchema
All Implemented Interfaces:
MessageSource, Target

public class JsonSchema
extends Object
implements Target, MessageSource


Field Summary
static int TARGET_JSONSCHEMA
           
 
Constructor Summary
JsonSchema()
           
 
Method Summary
 int getTargetID()
           
 void initialise(PackageInfo p, Model m, Options o, ShapeChangeResult r, boolean diagOnly)
          Initialize target generation for the JSON Schema output.
 String message(int mnr)
          This method returns messages belonging to the JSON Schema target by their message number.
protected  String messageText(int mnr)
          This is the message text provision proper.
 void process(ClassInfo ci)
          The converter will call this method for each class belonging to the package given during initialization (see Target.initialise(de.interactive_instruments.ShapeChange.Model.PackageInfo, de.interactive_instruments.ShapeChange.Model.Model, de.interactive_instruments.ShapeChange.Options, de.interactive_instruments.ShapeChange.ShapeChangeResult, boolean)).
 void write()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TARGET_JSONSCHEMA

public static final int TARGET_JSONSCHEMA
See Also:
Constant Field Values
Constructor Detail

JsonSchema

public JsonSchema()
Method Detail

initialise

public void initialise(PackageInfo p,
                       Model m,
                       Options o,
                       ShapeChangeResult r,
                       boolean diagOnly)
                throws ShapeChangeAbortException

Initialize target generation for the JSON Schema output.

Specified by:
initialise in interface Target
Parameters:
pi - UML Package represented by PackageInfo interface
m - Model represented by Model interface
r - Result class for diagnostics output
diagOnly - Flag requesting to suppress any output
Throws:
ShapeChangeAbortException
See Also:
Model.selectedSchemas(), PackageInfo.isSchema()

process

public void process(ClassInfo ci)
Description copied from interface: Target
The converter will call this method for each class belonging to the package given during initialization (see Target.initialise(de.interactive_instruments.ShapeChange.Model.PackageInfo, de.interactive_instruments.ShapeChange.Model.Model, de.interactive_instruments.ShapeChange.Options, de.interactive_instruments.ShapeChange.ShapeChangeResult, boolean)).

NOTE: will be called not only for the classes directly contained in the package, but also all sub-packages belonging to the same targetNamespace!

Specified by:
process in interface Target

write

public void write()
Specified by:
write in interface Target

message

public String message(int mnr)

This method returns messages belonging to the JSON Schema target by their message number. The organization corresponds to the logic in module ShapeChangeResult. All functions in that class, which require an message number can be redirected to the function at hand.

Specified by:
message in interface MessageSource
Parameters:
mnr - Message number
Returns:
Message text, including $x$ substitution points.

messageText

protected String messageText(int mnr)
This is the message text provision proper. It returns a message for a number.

Parameters:
mnr - Message number
Returns:
Message text or null

getTargetID

public int getTargetID()
Specified by:
getTargetID in interface Target


Copyright © 2015. All rights reserved.